summaryrefslogtreecommitdiffstats
path: root/src/common/Network/Packet/TCPHeader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Network/Packet/TCPHeader.cpp')
-rwxr-xr-xsrc/common/Network/Packet/TCPHeader.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/common/Network/Packet/TCPHeader.cpp b/src/common/Network/Packet/TCPHeader.cpp
new file mode 100755
index 00000000..bf28db2e
--- /dev/null
+++ b/src/common/Network/Packet/TCPHeader.cpp
@@ -0,0 +1,35 @@
+/*
+Copyright (c) 2015-2015 Cisco Systems, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+#include "TcpHeader.h"
+
+
+
+void TCPHeader::dump(FILE *fd)
+{
+ fprintf(fd, "\nTCPHeader");
+ fprintf(fd, "\nSourcePort 0x%.4X, DestPort 0x%.4X",
+ getSourcePort(), getDestPort());
+ fprintf(fd, "\nSeqNum 0x%.8lX, AckNum 0x%.8lX, Window %d",
+ getSeqNumber(), getAckNumber(), getWindowSize());
+ fprintf(fd, "\nHeader Length : %d, Checksum : 0x%.4X",
+ getHeaderLength(), getChecksum());
+ fprintf(fd, "\nFlags : SYN - %d, FIN - %d, ACK - %d, URG - %d, RST - %d, PSH - %d",
+ getSynFlag(), getFinFlag(), getAckFlag(), getUrgentFlag(), getResetFlag(), getPushFlag());
+ fprintf(fd, "\nUrgent Offset %d", getUrgentOffset());
+ fprintf(fd, "\n");
+}