1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 #ifndef DATA_STRUCTURES_TCP_H
20 #define DATA_STRUCTURES_TCP_H
30 uint32_t saddr
, daddr
;
31 uint16_t source
, dest
;
36 ConnectionKey connectionKey
;
39 uint32_t seq
, ack_seq
;
41 uint8_t ack
, rst
, syn
, fin
;
46 // lttng metainformation
47 unsigned long traceNum
;
50 // kernel metainformation
53 // packet header fields
59 NetEvent
* inE
, * outE
;
75 void convertIP(char* const str
, const uint32_t addr
);
76 void printPacket(const Packet
* const packet
);
78 // ConnectionKey-related functions
79 bool connectionKeyEqual(const ConnectionKey
* const a
, const ConnectionKey
*
82 // NetEvent-related functions
83 void destroyNetEvent(NetEvent
* const event
);
85 // Packet-related functions
86 bool isAcking(const Packet
* const ackPacket
, const Packet
* const ackedPacket
);
87 void destroyPacket(Packet
* const packet
);
89 // ConnectionKey-related Glib functions
90 guint
ghfConnectionKeyHash(gconstpointer key
);
91 gboolean
gefConnectionKeyEqual(gconstpointer a
, gconstpointer b
);
92 void gdnConnectionKeyDestroy(gpointer data
);
94 // PacketKey-related Glib functions
95 guint
ghfPacketKeyHash(gconstpointer key
);
96 gboolean
gefPacketKeyEqual(gconstpointer a
, gconstpointer b
);
98 // NetEvent-related Glib functions
99 void gdnDestroyNetEvent(gpointer data
);
101 // Packet-related Glib functions
102 void gdnPacketListDestroy(gpointer data
);
103 void gfPacketDestroy(gpointer data
, gpointer user_data
);
104 gint
gcfPacketAckCompare(gconstpointer a
, gconstpointer b
);