Changeset e7bc155
- Timestamp:
- 04/08/06 17:02:24 (16 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 3be9a2b
- Parents:
- ce0d2cc
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace.h
rce0d2cc re7bc155 217 217 218 218 /** IPv6 header structure */ 219 typedef PACKEDstruct libtrace_ip6219 typedef struct libtrace_ip6 220 220 { 221 221 uint32_t flow; … … 225 225 struct in6_addr ip_src; /**< source address */ 226 226 struct in6_addr ip_dst; /**< dest address */ 227 } libtrace_ip6_t;227 } PACKED libtrace_ip6_t; 228 228 229 229 /** Structure for dealing with TCP packets */ 230 230 typedef struct libtrace_tcp 231 231 { 232 u _int16_t source; /**< Source Port */233 u _int16_t dest; /**< Destination port */234 u _int32_t seq; /**< Sequence number */235 u _int32_t ack_seq; /**< Acknowledgement Number */232 uint16_t source; /**< Source Port */ 233 uint16_t dest; /**< Destination port */ 234 uint32_t seq; /**< Sequence number */ 235 uint32_t ack_seq; /**< Acknowledgement Number */ 236 236 # if BYTE_ORDER == LITTLE_ENDIAN 237 237 unsigned int res1:4; /**< Reserved bits */ … … 257 257 # error "Adjust your <bits/endian.h> defines" 258 258 # endif 259 u _int16_t window; /**< Window Size */260 u _int16_t check; /**< Checksum */261 u _int16_t urg_ptr; /**< Urgent Pointer */262 } __attribute__ ((packed))libtrace_tcp_t;259 uint16_t window; /**< Window Size */ 260 uint16_t check; /**< Checksum */ 261 uint16_t urg_ptr; /**< Urgent Pointer */ 262 } PACKED libtrace_tcp_t; 263 263 264 264 /** UDP Header for dealing with UDP packets */ 265 265 typedef struct libtrace_udp { 266 u _int16_t source; /**< Source port */267 u _int16_t dest; /**< Destination port */268 u _int16_t len; /**< Length */269 u _int16_t check; /**< Checksum */270 } __attribute__ ((packed))libtrace_udp_t;266 uint16_t source; /**< Source port */ 267 uint16_t dest; /**< Destination port */ 268 uint16_t len; /**< Length */ 269 uint16_t check; /**< Checksum */ 270 } PACKED libtrace_udp_t; 271 271 272 272 /** ICMP Header for dealing with icmp packets */ 273 273 typedef struct libtrace_icmp 274 274 { 275 u _int8_t type; /**< message type */276 u _int8_t code; /**< type sub-code */277 u _int16_t checksum; /**< checksum */275 uint8_t type; /**< message type */ 276 uint8_t code; /**< type sub-code */ 277 uint16_t checksum; /**< checksum */ 278 278 union 279 279 { 280 280 struct 281 281 { 282 u _int16_t id;283 u _int16_t sequence;282 uint16_t id; 283 uint16_t sequence; 284 284 } echo; /**< echo datagram */ 285 u _int32_t gateway; /**< gateway address */285 uint32_t gateway; /**< gateway address */ 286 286 struct 287 287 { 288 u _int16_t unused;289 u _int16_t mtu;288 uint16_t unused; 289 uint16_t mtu; 290 290 } frag; /**< path mtu discovery */ 291 291 } un; /**< Union for payloads of various icmp codes */ 292 } __attribute__ ((packed))libtrace_icmp_t;292 } PACKED libtrace_icmp_t; 293 293 294 294 /** LLC/SNAP header */ 295 295 typedef struct libtrace_llcsnap 296 296 { 297 u _int8_t dsap;298 u _int8_t ssap;299 u _int8_t control;300 u _int32_t oui:24;301 u _int16_t type;302 } __attribute__ ((packed))libtrace_llcsnap_t;297 uint8_t dsap; 298 uint8_t ssap; 299 uint8_t control; 300 uint32_t oui:24; 301 uint16_t type; 302 } PACKED libtrace_llcsnap_t; 303 303 304 304 /** 802.3 frame */ 305 305 typedef struct libtrace_ether 306 306 { 307 u _int8_t ether_dhost[6]; /**< destination ether addr */308 u _int8_t ether_shost[6]; /**< source ether addr */309 u _int16_t ether_type; /**< packet type ID field (next-header) */310 } __attribute__ ((packed))libtrace_ether_t;307 uint8_t ether_dhost[6]; /**< destination ether addr */ 308 uint8_t ether_shost[6]; /**< source ether addr */ 309 uint16_t ether_type; /**< packet type ID field (next-header) */ 310 } PACKED libtrace_ether_t; 311 311 312 312 /** 802.1Q frame */ 313 313 typedef struct libtrace_8021q 314 314 { 315 u _int8_t ether_dhost[6]; /**< destination eth addr */316 u _int8_t ether_shost[6]; /**< source ether addr */317 u _int16_t ether_type; /**< packet type ID field , 0x8100 for VLAN */315 uint8_t ether_dhost[6]; /**< destination eth addr */ 316 uint8_t ether_shost[6]; /**< source ether addr */ 317 uint16_t ether_type; /**< packet type ID field , 0x8100 for VLAN */ 318 318 unsigned int vlan_pri:3; /**< vlan user priority */ 319 319 unsigned int vlan_cfi:1; /**< vlan format indicator, 320 320 * 0 for ethernet, 1 for token ring */ 321 321 unsigned int vlan_id:12; /**< vlan id */ 322 u _int16_t vlan_ether_type; /**< vlan sub-packet type ID field322 uint16_t vlan_ether_type; /**< vlan sub-packet type ID field 323 323 * (next-header)*/ 324 } __attribute__ ((packed))libtrace_8021q_t;324 } PACKED libtrace_8021q_t; 325 325 326 326 /** ATM cell */ … … 328 328 { 329 329 unsigned int gfc:4; 330 u _int8_t vpi;331 u _int16_t vci;330 uint8_t vpi; 331 uint16_t vci; 332 332 unsigned int pt:3; 333 333 unsigned int clp:1; 334 334 unsigned int hec; 335 } __attribute__ ((packed))libtrace_atm_cell_t;335 } PACKED libtrace_atm_cell_t; 336 336 337 337 /** POS header */ 338 338 typedef struct libtrace_pos 339 339 { 340 u _int16_t header;341 u _int16_t ether_type; /**< ether type */342 } __attribute__ ((packed))libtrace_pos_t;340 uint16_t header; 341 uint16_t ether_type; /**< ether type */ 342 } PACKED libtrace_pos_t; 343 343 344 344 /** 802.11 header */ … … 361 361 uint16_t SeqCtl; 362 362 uint8_t mac4[6]; 363 } libtrace_80211_t; 363 } PACKED libtrace_80211_t; 364 365 #ifdef WIN32 366 #pragma pack(pop) 367 #endif 364 368 365 369 … … 1196 1200 enum base_format_t trace_get_format(struct libtrace_packet_t *packet); 1197 1201 1198 1199 1202 #ifdef __cplusplus 1200 1203 } /* extern "C" */ -
lib/malloc.c
rdb06c9d re7bc155 5 5 6 6 #include <sys/types.h> 7 #include <stdlib.h> 7 8 8 9 void *malloc ();
Note: See TracChangeset
for help on using the changeset viewer.