From 55545fff0c44fc1266837c0c0ee1108b3189ff64 Mon Sep 17 00:00:00 2001 From: Thomas Habets Date: Tue, 6 Oct 2009 23:30:06 +0200 Subject: Replace u_intX_t with C99 uintX_t. --- libnet/include/ifaddrlist.h | 8 +- libnet/include/libnet/libnet-asn1.h | 66 ++-- libnet/include/libnet/libnet-functions.h | 430 ++++++++++----------- libnet/include/libnet/libnet-headers.h | 598 +++++++++++++++--------------- libnet/include/libnet/libnet-macros.h | 8 +- libnet/include/libnet/libnet-structures.h | 30 +- 6 files changed, 570 insertions(+), 570 deletions(-) (limited to 'libnet/include') diff --git a/libnet/include/ifaddrlist.h b/libnet/include/ifaddrlist.h index 8ba7380..e2d819c 100644 --- a/libnet/include/ifaddrlist.h +++ b/libnet/include/ifaddrlist.h @@ -23,16 +23,16 @@ struct ifaddrlist { #if (HAVE_SOLARIS || HAVE_HPUX11) - u_int addr; + uint addr; #else - u_int32_t addr; + uint32_t addr; #endif char *device; }; struct libnet_ifaddr_list { - u_int32_t addr; + uint32_t addr; char *device; }; @@ -46,7 +46,7 @@ ifaddrlist( int set_up_interface( struct sockaddr_in **, - u_int8_t ** + uint8_t ** ); /* EOF */ diff --git a/libnet/include/libnet/libnet-asn1.h b/libnet/include/libnet/libnet-asn1.h index ea27356..20ea8ae 100644 --- a/libnet/include/libnet/libnet-asn1.h +++ b/libnet/include/libnet/libnet-asn1.h @@ -57,10 +57,10 @@ #define __LIBNET_ASN1_H #ifndef EIGHTBIT_SUBIDS -typedef u_int32_t oid; +typedef uint32_t oid; #define MAX_SUBID 0xFFFFFFFF #else -typedef u_int8_t oid; +typedef uint8_t oid; #define MAX_SUBID 0xFF #endif @@ -94,14 +94,14 @@ typedef u_int8_t oid; * All of the build_asn1_* (build_asn1_length being an exception) functions * take the same first 3 arguments: * - * u_int8_t *data: This is a pointer to the start of the data object to be + * uint8_t *data: This is a pointer to the start of the data object to be * manipulated. * int *datalen: This is a pointer to the number of valid bytes following * "data". This should be not be exceeded in any function. * Upon exiting a function, this value will reflect the * changed "data" and then refer to the new number of valid * bytes until the end of "data". - * u_int8_t type: The ASN.1 object type. + * uint8_t type: The ASN.1 object type. */ @@ -112,11 +112,11 @@ typedef u_int8_t oid; * this object (the start of the next object). */ -u_int8_t * +uint8_t * libnet_build_asn1_int( - u_int8_t *, /* Pointer to the output buffer */ + uint8_t *, /* Pointer to the output buffer */ int *, /* Number of valid bytes left in the buffer */ - u_int8_t, /* ASN object type */ + uint8_t, /* ASN object type */ int32_t *, /* Pointer to a int32_t integer */ int /* Size of a int32_t integer */ ); @@ -129,12 +129,12 @@ libnet_build_asn1_int( * this object (the start of the next object). */ -u_int8_t * +uint8_t * libnet_build_asn1_uint( - u_int8_t *, /* Pointer to the output buffer */ + uint8_t *, /* Pointer to the output buffer */ int *, /* Number of valid bytes left in the buffer */ - u_int8_t, /* ASN object type */ - u_int32_t *, /* Pointer to an unsigned int32_t integer */ + uint8_t, /* ASN object type */ + uint32_t *, /* Pointer to an unsigned int32_t integer */ int /* Size of a int32_t integer */ ); @@ -146,12 +146,12 @@ libnet_build_asn1_uint( * this object (the start of the next object). */ -u_int8_t * +uint8_t * libnet_build_asn1_string( - u_int8_t *, /* Pointer to the output buffer */ + uint8_t *, /* Pointer to the output buffer */ int *, /* Number of valid bytes left in the buffer */ - u_int8_t, /* ASN object type */ - u_int8_t *, /* Pointer to a string to be built into an object */ + uint8_t, /* ASN object type */ + uint8_t *, /* Pointer to a string to be built into an object */ int /* Size of the string */ ); @@ -165,18 +165,18 @@ libnet_build_asn1_string( * NULL upon error */ -u_int8_t * +uint8_t * libnet_build_asn1_header( - u_int8_t *, /* Pointer to the start of the object */ + uint8_t *, /* Pointer to the start of the object */ int *, /* Number of valid bytes left in buffer */ - u_int8_t, /* ASN object type */ + uint8_t, /* ASN object type */ int /* ASN object length */ ); -u_int8_t * +uint8_t * libnet_build_asn1_length( - u_int8_t *, /* Pointer to start of object */ + uint8_t *, /* Pointer to start of object */ int *, /* Number of valid bytes in buffer */ int /* Length of object */ ); @@ -192,11 +192,11 @@ libnet_build_asn1_length( * Returns NULL on any error. */ -u_int8_t * +uint8_t * libnet_build_asn1_sequence( - u_int8_t *, + uint8_t *, int *, - u_int8_t, + uint8_t, int ); @@ -208,11 +208,11 @@ libnet_build_asn1_sequence( * this object (the start of the next object). */ -u_int8_t * +uint8_t * libnet_build_asn1_objid( - u_int8_t *, + uint8_t *, int *, - u_int8_t, + uint8_t, oid *, int ); @@ -225,11 +225,11 @@ libnet_build_asn1_objid( * this object (the start of the next object). */ -u_int8_t * +uint8_t * libnet_build_asn1_null( - u_int8_t *, + uint8_t *, int *, - u_int8_t + uint8_t ); @@ -240,12 +240,12 @@ libnet_build_asn1_null( * this object (the start of the next object). */ -u_int8_t * +uint8_t * libnet_build_asn1_bitstring( - u_int8_t *, + uint8_t *, int *, - u_int8_t, - u_int8_t *, /* Pointer to the input buffer */ + uint8_t, + uint8_t *, /* Pointer to the input buffer */ int /* Length of the input buffer */ ); diff --git a/libnet/include/libnet/libnet-functions.h b/libnet/include/libnet/libnet-functions.h index a9e18bb..23ac704 100644 --- a/libnet/include/libnet/libnet-functions.h +++ b/libnet/include/libnet/libnet-functions.h @@ -114,7 +114,7 @@ libnet_getdevice(libnet_t *l); * @param ptag the ptag reference number * @return a pointer to the pblock buffer or NULL on error */ -u_int8_t * +uint8_t * libnet_getpbuf(libnet_t *l, libnet_ptag_t ptag); /** @@ -125,7 +125,7 @@ libnet_getpbuf(libnet_t *l, libnet_ptag_t ptag); * @param ptag the ptag reference number * @return the size of the pblock buffer */ -u_int32_t +uint32_t libnet_getpbuf_size(libnet_t *l, libnet_ptag_t ptag); /** @@ -144,7 +144,7 @@ libnet_geterror(libnet_t *l); * @param l pointer to a libnet context * @return the size of the packet in l */ -u_int32_t +uint32_t libnet_getpacket_size(libnet_t *l); /** @@ -168,7 +168,7 @@ libnet_seed_prand(libnet_t *l); * @param mod one the of LIBNET_PR* constants * @return 1 on success, -1 on failure */ -u_int32_t +uint32_t libnet_get_prand(int mod); /** @@ -208,7 +208,7 @@ libnet_toggle_checksum(libnet_t *l, libnet_ptag_t ptag, int mode); * @return a pointer to presentation format string */ char * -libnet_addr2name4(u_int32_t in, u_int8_t use_name); +libnet_addr2name4(uint32_t in, uint8_t use_name); /** * Takes a dotted decimal string or a canonical DNS name and returns a @@ -223,8 +223,8 @@ libnet_addr2name4(u_int32_t in, u_int8_t use_name); * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE * @return network byte ordered IPv4 address or -1 (2^32 - 1) on error */ -u_int32_t -libnet_name2addr4(libnet_t *l, char *host_name, u_int8_t use_name); +uint32_t +libnet_name2addr4(libnet_t *l, char *host_name, uint8_t use_name); extern const struct libnet_in6_addr in6addr_error; @@ -242,13 +242,13 @@ extern const struct libnet_in6_addr in6addr_error; * @return network byte ordered IPv6 address structure */ struct libnet_in6_addr -libnet_name2addr6(libnet_t *l, char *host_name, u_int8_t use_name); +libnet_name2addr6(libnet_t *l, char *host_name, uint8_t use_name); /** * Should document this baby right here. */ void -libnet_addr2name6_r(struct libnet_in6_addr addr, u_int8_t use_name, +libnet_addr2name6_r(struct libnet_in6_addr addr, uint8_t use_name, char *host_name, int host_name_len); /** @@ -281,8 +281,8 @@ libnet_plist_chain_new(libnet_t *l, libnet_plist_t **plist, char *token_list); * @return 1 on success, 0 if empty, -1 on failure */ int -libnet_plist_chain_next_pair(libnet_plist_t *plist, u_int16_t *bport, -u_int16_t *eport); +libnet_plist_chain_next_pair(libnet_plist_t *plist, uint16_t *bport, +uint16_t *eport); /** * Runs through the port list and prints the contents of the port list chain @@ -354,7 +354,7 @@ libnet_plist_chain_free(libnet_plist_t *plist); * - Building another protocol header that is not available from a libnet * interface * To employ the interface, the application programmer should construct the i - * payload data and pass a u_int8_t * to this data and its size to the desired + * payload data and pass a uint8_t * to this data and its size to the desired * libnet_build() function. Libnet handles the rest. * * It is important to note that some functions (notably the IPv6 builders) do @@ -400,9 +400,9 @@ libnet_plist_chain_free(libnet_plist_t *plist); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_802_1q(u_int8_t *dst, u_int8_t *src, u_int16_t tpi, -u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_802_1q(uint8_t *dst, uint8_t *src, uint16_t tpi, +uint8_t priority, uint8_t cfi, uint16_t vlan_id, uint16_t len_proto, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IEEE 802.1x extended authentication protocol header. @@ -416,8 +416,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_802_1x(u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_802_1x(uint8_t eap_ver, uint8_t eap_type, uint16_t length, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IEEE 802.2 LLC header. @@ -431,8 +431,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_802_2(u_int8_t dsap, u_int8_t ssap, u_int8_t control, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_802_2(uint8_t dsap, uint8_t ssap, uint8_t control, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IEEE 802.2 LLC SNAP header. @@ -448,8 +448,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_802_2snap(u_int8_t dsap, u_int8_t ssap, u_int8_t control, -u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, +libnet_build_802_2snap(uint8_t dsap, uint8_t ssap, uint8_t control, +uint8_t *oui, uint16_t type, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -468,8 +468,8 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_802_3(u_int8_t *dst, u_int8_t *src, u_int16_t len, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_802_3(uint8_t *dst, uint8_t *src, uint16_t len, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an Ethernet header. The RFC 894 Ethernet II header is almost @@ -487,8 +487,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ethernet(u_int8_t *dst, u_int8_t *src, u_int16_t type, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ethernet(uint8_t *dst, uint8_t *src, uint16_t type, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Autobuilds an Ethernet header. The RFC 894 Ethernet II header is almost @@ -502,7 +502,7 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_ethernet(u_int8_t *dst, u_int16_t type, libnet_t *l); +libnet_autobuild_ethernet(uint8_t *dst, uint16_t type, libnet_t *l); /** * Builds a Fiber Distributed Data Interface (FDDI) header. @@ -521,9 +521,9 @@ libnet_autobuild_ethernet(u_int8_t *dst, u_int16_t type, libnet_t *l); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap, -u_int8_t ssap, u_int8_t cf, u_int8_t *oui, u_int16_t type, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_fddi(uint8_t fc, uint8_t *dst, uint8_t *src, uint8_t dsap, +uint8_t ssap, uint8_t cf, uint8_t *oui, uint16_t type, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Autobuilds a Fiber Distributed Data Interface (FDDI) header. @@ -538,8 +538,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, -u_int8_t cf, u_int8_t *oui, u_int16_t type, libnet_t *l); +libnet_autobuild_fddi(uint8_t fc, uint8_t *dst, uint8_t dsap, uint8_t ssap, +uint8_t cf, uint8_t *oui, uint16_t type, libnet_t *l); /** * Builds an Address Resolution Protocol (ARP) header. Depending on the op @@ -561,9 +561,9 @@ u_int8_t cf, u_int8_t *oui, u_int16_t type, libnet_t *l); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_arp(u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, -u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_arp(uint16_t hrd, uint16_t pro, uint8_t hln, uint8_t pln, +uint16_t op, uint8_t *sha, uint8_t *spa, uint8_t *tha, uint8_t *tpa, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Autouilds an Address Resolution Protocol (ARP) header. Depending on the op @@ -578,8 +578,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_arp(u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, -u_int8_t *tpa, libnet_t *l); +libnet_autobuild_arp(uint16_t op, uint8_t *sha, uint8_t *spa, uint8_t *tha, +uint8_t *tpa, libnet_t *l); /** * Builds an RFC 793 Transmission Control Protocol (TCP) header. @@ -599,9 +599,9 @@ u_int8_t *tpa, libnet_t *l); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_tcp(u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack, -u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_tcp(uint16_t sp, uint16_t dp, uint32_t seq, uint32_t ack, +uint8_t control, uint16_t win, uint16_t sum, uint16_t urg, uint16_t len, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an RFC 793 Transmission Control Protocol (TCP) options header. @@ -619,7 +619,7 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_tcp_options(u_int8_t *options, u_int32_t options_s, libnet_t *l, +libnet_build_tcp_options(uint8_t *options, uint32_t options_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -635,8 +635,8 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_udp(u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_udp(uint16_t sp, uint16_t dp, uint16_t len, uint16_t sum, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a Cisco Discovery Protocol (CDP) header. Cisco Systems designed CDP @@ -658,8 +658,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_cdp(u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type, -u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s, +libnet_build_cdp(uint8_t version, uint8_t ttl, uint16_t sum, uint16_t type, +uint16_t len, uint8_t *value, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -677,8 +677,8 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_icmpv4_echo(u_int8_t type, u_int8_t code, u_int16_t sum, -u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s, +libnet_build_icmpv4_echo(uint8_t type, uint8_t code, uint16_t sum, +uint16_t id, uint16_t seq, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -697,9 +697,9 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_icmpv4_mask(u_int8_t type, u_int8_t code, u_int16_t sum, -u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_icmpv4_mask(uint8_t type, uint8_t code, uint16_t sum, +uint16_t id, uint16_t seq, uint32_t mask, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) @@ -715,8 +715,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_icmpv4_unreach(u_int8_t type, u_int8_t code, u_int16_t sum, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_icmpv4_unreach(uint8_t type, uint8_t code, uint16_t sum, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IP version 4 RFC 792 Internet Message Control Protocol (ICMP) @@ -733,8 +733,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_icmpv4_redirect(u_int8_t type, u_int8_t code, u_int16_t sum, -u_int32_t gateway, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_icmpv4_redirect(uint8_t type, uint8_t code, uint16_t sum, +uint32_t gateway, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -752,8 +752,8 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_icmpv4_timeexceed(u_int8_t type, u_int8_t code, u_int16_t sum, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_icmpv4_timeexceed(uint8_t type, uint8_t code, uint16_t sum, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) @@ -773,9 +773,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_icmpv4_timestamp(u_int8_t type, u_int8_t code, u_int16_t sum, -u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_icmpv4_timestamp(uint8_t type, uint8_t code, uint16_t sum, +uint16_t id, uint16_t seq, n_time otime, n_time rtime, n_time ttime, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header. @@ -790,8 +790,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_igmp(u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_igmp(uint8_t type, uint8_t code, uint16_t sum, uint32_t ip, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a version 4 RFC 791 Internet Protocol (IP) header. @@ -813,9 +813,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv4(u_int16_t ip_len, u_int8_t tos, u_int16_t id, u_int16_t frag, -u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipv4(uint16_t ip_len, uint8_t tos, uint16_t id, uint16_t frag, +uint8_t ttl, uint8_t prot, uint16_t sum, uint32_t src, uint32_t dst, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an version 4 Internet Protocol (IP) options header. The function @@ -836,7 +836,7 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv4_options(u_int8_t *options, u_int32_t options_s, libnet_t *l, +libnet_build_ipv4_options(uint8_t *options, uint32_t options_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -853,7 +853,7 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_ipv4(u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l); +libnet_autobuild_ipv4(uint16_t len, uint8_t prot, uint32_t dst, libnet_t *l); /** * Builds a version 6 RFC 2460 Internet Protocol (IP) header. @@ -871,9 +871,9 @@ libnet_autobuild_ipv4(u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv6(u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh, -u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipv6(uint8_t tc, uint32_t fl, uint16_t len, uint8_t nh, +uint8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header. @@ -888,8 +888,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv6_frag(u_int8_t nh, u_int8_t reserved, u_int16_t frag, -u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_ipv6_frag(uint8_t nh, uint8_t reserved, uint16_t frag, +uint32_t id, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -910,8 +910,8 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv6_routing(u_int8_t nh, u_int8_t len, u_int8_t rtype, -u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_ipv6_routing(uint8_t nh, uint8_t len, uint8_t rtype, +uint8_t segments, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -928,8 +928,8 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv6_destopts(u_int8_t nh, u_int8_t len, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipv6_destopts(uint8_t nh, uint8_t len, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a version 6 RFC 2460 Internet Protocol (IP) hop by hop options @@ -946,8 +946,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipv6_hbhopts(u_int8_t nh, u_int8_t len, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipv6_hbhopts(uint8_t nh, uint8_t len, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * This function is not yet implement and is a NOOP. @@ -959,7 +959,7 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_ipv6(u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, +libnet_autobuild_ipv6(uint16_t len, uint8_t nh, struct libnet_in6_addr dst, libnet_t *l, libnet_ptag_t ptag); /** @@ -980,10 +980,10 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_isl(u_int8_t *dhost, u_int8_t type, u_int8_t user, -u_int8_t *shost, u_int16_t len, u_int8_t *snap, u_int16_t vid, -u_int16_t portindex, u_int16_t reserved, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_isl(uint8_t *dhost, uint8_t type, uint8_t user, +uint8_t *shost, uint16_t len, uint8_t *snap, uint16_t vid, +uint16_t portindex, uint16_t reserved, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an Internet Protocol Security Encapsulating Security Payload header. @@ -997,8 +997,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipsec_esp_hdr(u_int32_t spi, u_int32_t seq, u_int32_t iv, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipsec_esp_hdr(uint32_t spi, uint32_t seq, uint32_t iv, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an Internet Protocol Security Encapsulating Security Payload footer. @@ -1012,8 +1012,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipsec_esp_ftr(u_int8_t len, u_int8_t nh, int8_t *auth, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipsec_esp_ftr(uint8_t len, uint8_t nh, int8_t *auth, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an Internet Protocol Security Authentication header. @@ -1030,9 +1030,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ipsec_ah(u_int8_t nh, u_int8_t len, u_int16_t res, -u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ipsec_ah(uint8_t nh, uint8_t len, uint16_t res, +uint32_t spi, uint32_t seq, uint32_t auth, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an RFC 1035 version 4 DNS header. Additional DNS payload information @@ -1051,9 +1051,9 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_dnsv4(u_int16_t h_len, u_int16_t id, u_int16_t flags, -u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr, -u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_dnsv4(uint16_t h_len, uint16_t id, uint16_t flags, +uint16_t num_q, uint16_t num_anws_rr, uint16_t num_auth_rr, +uint16_t num_addi_rr, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1074,9 +1074,9 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_rip(u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, -u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop, -u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_rip(uint8_t cmd, uint8_t version, uint16_t rd, uint16_t af, +uint16_t rt, uint32_t addr, uint32_t mask, uint32_t next_hop, +uint32_t metric, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1102,10 +1102,10 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_rpc_call(u_int32_t rm, u_int32_t xid, u_int32_t prog_num, -u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength, -u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_rpc_call(uint32_t rm, uint32_t xid, uint32_t prog_num, +uint32_t prog_vers, uint32_t procedure, uint32_t cflavor, uint32_t clength, +uint8_t *cdata, uint32_t vflavor, uint32_t vlength, uint8_t *vdata, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IEEE 802.1d Spanning Tree Protocol (STP) configuration header. @@ -1130,11 +1130,11 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_stp_conf(u_int16_t id, u_int8_t version, u_int8_t bpdu_type, -u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id, -u_int16_t port_id, u_int16_t message_age, u_int16_t max_age, -u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_stp_conf(uint16_t id, uint8_t version, uint8_t bpdu_type, +uint8_t flags, uint8_t *root_id, uint32_t root_pc, uint8_t *bridge_id, +uint16_t port_id, uint16_t message_age, uint16_t max_age, +uint16_t hello_time, uint16_t f_delay, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds an IEEE 802.1d Spanning Tree Protocol (STP) topology change @@ -1150,8 +1150,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_stp_tcn(u_int16_t id, u_int8_t version, u_int8_t bpdu_type, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_stp_tcn(uint16_t id, uint8_t version, uint8_t bpdu_type, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a token ring header. @@ -1171,9 +1171,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src, -u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *oui, u_int16_t type, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_token_ring(uint8_t ac, uint8_t fc, uint8_t *dst, uint8_t *src, +uint8_t dsap, uint8_t ssap, uint8_t cf, uint8_t *oui, uint16_t type, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Auto-builds a token ring header. @@ -1189,8 +1189,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst, -u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *oui, u_int16_t type, +libnet_autobuild_token_ring(uint8_t ac, uint8_t fc, uint8_t *dst, +uint8_t dsap, uint8_t ssap, uint8_t cf, uint8_t *oui, uint16_t type, libnet_t *l); /** @@ -1213,9 +1213,9 @@ libnet_t *l); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_vrrp(u_int8_t version, u_int8_t type, u_int8_t vrouter_id, -u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int, -u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_vrrp(uint8_t version, uint8_t type, uint8_t vrouter_id, +uint8_t priority, uint8_t ip_count, uint8_t auth_type, uint8_t advert_int, +uint16_t sum, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1231,8 +1231,8 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_mpls(u_int32_t label, u_int8_t experimental, u_int8_t bos, -u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_mpls(uint32_t label, uint8_t experimental, uint8_t bos, +uint8_t ttl, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1263,13 +1263,13 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ntp(u_int8_t leap_indicator, u_int8_t version, u_int8_t mode, -u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int, -u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac, -u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac, -u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int, -u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ntp(uint8_t leap_indicator, uint8_t version, uint8_t mode, +uint8_t stratum, uint8_t poll, uint8_t precision, uint16_t delay_int, +uint16_t delay_frac, uint16_t dispersion_int, uint16_t dispersion_frac, +uint32_t reference_id, uint32_t ref_ts_int, uint32_t ref_ts_frac, +uint32_t orig_ts_int, uint32_t orig_ts_frac, uint32_t rec_ts_int, +uint32_t rec_ts_frac, uint32_t xmt_ts_int, uint32_t xmt_ts_frac, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param len @@ -1285,9 +1285,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2(u_int16_t len, u_int8_t type, u_int32_t rtr_id, -u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2(uint16_t len, uint8_t type, uint32_t rtr_id, +uint32_t area_id, uint16_t sum, uint16_t autype, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param netmask @@ -1304,9 +1304,9 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_hello(u_int32_t netmask, u_int16_t interval, u_int8_t opts, -u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2_hello(uint32_t netmask, uint16_t interval, uint8_t opts, +uint8_t priority, uint dead_int, uint32_t des_rtr, uint32_t bkup_rtr, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param dgram_len @@ -1320,8 +1320,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_dbd(u_int16_t dgram_len, u_int8_t opts, u_int8_t type, -u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_ospfv2_dbd(uint16_t dgram_len, uint8_t opts, uint8_t type, +uint seqnum, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1335,8 +1335,8 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsr(u_int type, u_int lsid, u_int32_t advrtr, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2_lsr(uint type, uint lsid, uint32_t advrtr, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param num @@ -1347,7 +1347,7 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsu(u_int num, u_int8_t *payload, u_int32_t payload_s, +libnet_build_ospfv2_lsu(uint num, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1366,9 +1366,9 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsa(u_int16_t age, u_int8_t opts, u_int8_t type, -u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2_lsa(uint16_t age, uint8_t opts, uint8_t type, +uint lsid, uint32_t advrtr, uint seqnum, uint16_t sum, uint16_t len, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param flags @@ -1385,9 +1385,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsa_rtr(u_int16_t flags, u_int16_t num, u_int id, -u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2_lsa_rtr(uint16_t flags, uint16_t num, uint id, +uint data, uint8_t type, uint8_t tos, uint16_t metric, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param nmask @@ -1399,8 +1399,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsa_net(u_int32_t nmask, u_int rtrid, u_int8_t *payload, -u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2_lsa_net(uint32_t nmask, uint rtrid, uint8_t *payload, +uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param nmask @@ -1413,8 +1413,8 @@ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsa_sum(u_int32_t nmask, u_int metric, u_int tos, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_ospfv2_lsa_sum(uint32_t nmask, uint metric, uint tos, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param nmask @@ -1428,8 +1428,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_ospfv2_lsa_as(u_int32_t nmask, u_int metric, u_int32_t fwdaddr, -u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_ospfv2_lsa_as(uint32_t nmask, uint metric, uint32_t fwdaddr, +uint tag, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1443,7 +1443,7 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_data(u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_data(uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1468,10 +1468,10 @@ libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_dhcpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen, -u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, -u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr, -u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s, +libnet_build_dhcpv4(uint8_t opcode, uint8_t htype, uint8_t hlen, +uint8_t hopcount, uint32_t xid, uint16_t secs, uint16_t flags, +uint32_t cip, uint32_t yip, uint32_t sip, uint32_t gip, uint8_t *chaddr, +uint8_t *sname, uint8_t *file, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1496,18 +1496,18 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_bootpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen, -u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, -u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr, -u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s, +libnet_build_bootpv4(uint8_t opcode, uint8_t htype, uint8_t hlen, +uint8_t hopcount, uint32_t xid, uint16_t secs, uint16_t flags, +uint32_t cip, uint32_t yip, uint32_t sip, uint32_t gip, uint8_t *chaddr, +uint8_t *sname, uint8_t *file, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param fv see libnet_build_gre(). * @return size, see libnet_build_gre(). */ -u_int32_t -libnet_getgre_length(u_int16_t fv); +uint32_t +libnet_getgre_length(uint16_t fv); /** * Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any @@ -1532,9 +1532,9 @@ libnet_getgre_length(u_int16_t fv); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_gre(u_int16_t fv, u_int16_t type, u_int16_t sum, -u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_gre(uint16_t fv, uint16_t type, uint16_t sum, +uint16_t offset, uint32_t key, uint32_t seq, uint16_t len, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any @@ -1558,9 +1558,9 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_egre(u_int16_t fv, u_int16_t type, u_int16_t sum, -u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_egre(uint16_t fv, uint16_t type, uint16_t sum, +uint16_t offset, uint32_t key, uint32_t seq, uint16_t len, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * @param af @@ -1574,8 +1574,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_gre_sre(u_int16_t af, u_int8_t offset, u_int8_t length, -u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, +libnet_build_gre_sre(uint16_t af, uint8_t offset, uint8_t length, +uint8_t *routing, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1608,8 +1608,8 @@ libnet_build_gre_last_sre(libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_bgp4_header(u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], -u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s, +libnet_build_bgp4_header(uint8_t marker[LIBNET_BGP4_MARKER_SIZE], +uint16_t len, uint8_t type, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1629,8 +1629,8 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_bgp4_open(u_int8_t version, u_int16_t src_as, u_int16_t hold_time, -u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s, +libnet_build_bgp4_open(uint8_t version, uint16_t src_as, uint16_t hold_time, +uint32_t bgp_id, uint8_t opt_len, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1649,9 +1649,9 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_bgp4_update(u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt, -u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len, -u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s, +libnet_build_bgp4_update(uint16_t unfeasible_rt_len, uint8_t *withdrawn_rt, +uint16_t total_path_attr_len, uint8_t *path_attributes, uint16_t info_len, +uint8_t *reachability_info, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** @@ -1667,8 +1667,8 @@ libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_bgp4_notification(u_int8_t err_code, u_int8_t err_subcode, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_bgp4_notification(uint8_t err_code, uint8_t err_subcode, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a Sebek header. The Sebek protocol was designed by the Honeynet @@ -1692,10 +1692,10 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_sebek(u_int32_t magic, u_int16_t version, u_int16_t type, -u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid, -u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_sebek(uint32_t magic, uint16_t version, uint16_t type, +uint32_t counter, uint32_t time_sec, uint32_t time_usec, uint32_t pid, +uint32_t uid, uint32_t fd, uint8_t cmd[SEBEK_CMD_LENGTH], uint32_t length, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a HSRP header. HSRP is a Cisco propietary protocol defined in @@ -1717,10 +1717,10 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_hsrp(u_int8_t version, u_int8_t opcode, u_int8_t state, -u_int8_t hello_time, u_int8_t hold_time, u_int8_t priority, u_int8_t group, -u_int8_t reserved, u_int8_t authdata[HSRP_AUTHDATA_LENGTH], u_int32_t virtual_ip, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_hsrp(uint8_t version, uint8_t opcode, uint8_t state, +uint8_t hello_time, uint8_t hold_time, uint8_t priority, uint8_t group, +uint8_t reserved, uint8_t authdata[HSRP_AUTHDATA_LENGTH], uint32_t virtual_ip, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Builds a link layer header for an initialized l. The function @@ -1737,8 +1737,8 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_build_link(u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type, -u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); +libnet_build_link(uint8_t *dst, uint8_t *src, uint8_t *oui, uint16_t type, +uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag); /** * Automatically builds a link layer header for an initialized l. The function @@ -1751,7 +1751,7 @@ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); * @return protocol tag value on success, -1 on error */ libnet_ptag_t -libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_int16_t type, +libnet_autobuild_link(uint8_t *dst, uint8_t *oui, uint16_t type, libnet_t *l); /** @@ -1778,7 +1778,7 @@ libnet_write(libnet_t *l); * @return a big endian IP address suitable for use in a libnet_build function or -1 */ -u_int32_t +uint32_t libnet_get_ipaddr4(libnet_t *l); /** @@ -1809,7 +1809,7 @@ libnet_get_hwaddr(libnet_t *l); * @param len the resulting size of the returned byte string * @return a byte string or NULL on failure */ -u_int8_t * +uint8_t * libnet_hex_aton(const char *s, int *len); /** @@ -1835,7 +1835,7 @@ libnet_version(void); * @return 1 on success, -1 on failure */ int -libnet_adv_cull_packet(libnet_t *l, u_int8_t **packet, u_int32_t *packet_s); +libnet_adv_cull_packet(libnet_t *l, uint8_t **packet, uint32_t *packet_s); /** * [Advanced Interface] @@ -1850,8 +1850,8 @@ libnet_adv_cull_packet(libnet_t *l, u_int8_t **packet, u_int32_t *packet_s); * @return 1 on success, -1 on failure */ int -libnet_adv_cull_header(libnet_t *l, libnet_ptag_t ptag, u_int8_t **header, -u_int32_t *header_s); +libnet_adv_cull_header(libnet_t *l, libnet_ptag_t ptag, uint8_t **header, +uint32_t *header_s); /** * [Advanced Interface] @@ -1867,7 +1867,7 @@ u_int32_t *header_s); * @return the number of bytes written, or -1 on failure */ int -libnet_adv_write_link(libnet_t *l, u_int8_t *packet, u_int32_t packet_s); +libnet_adv_write_link(libnet_t *l, uint8_t *packet, uint32_t packet_s); /** * [Advanced Interface] @@ -1883,7 +1883,7 @@ libnet_adv_write_link(libnet_t *l, u_int8_t *packet, u_int32_t packet_s); * @return the number of bytes written, or -1 on failure */ int -libnet_adv_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t packet_s); +libnet_adv_write_raw_ipv4(libnet_t *l, uint8_t *packet, uint32_t packet_s); /** * [Advanced Interface] @@ -1892,7 +1892,7 @@ libnet_adv_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t packet_s); * @param packet a pointer to the packet to free */ void -libnet_adv_free_packet(libnet_t *l, u_int8_t *packet); +libnet_adv_free_packet(libnet_t *l, uint8_t *packet); /** * [Context Queue] @@ -2010,13 +2010,13 @@ libnet_cq_next(void); * Function returns the number of libnet contexts that are in the queue. * @return the number of libnet contexts currently in the queue */ -u_int32_t +uint32_t libnet_cq_size(void); /** * [Context Queue] */ -u_int32_t +uint32_t libnet_cq_end_loop(void); /** @@ -2042,7 +2042,7 @@ libnet_diag_dump_pblock(libnet_t *l); * @return a string representing the pblock type type or "unknown" for an unknown value */ char * -libnet_diag_dump_pblock_type(u_int8_t type); +libnet_diag_dump_pblock_type(uint8_t type); /** * [Diagnostic] @@ -2058,25 +2058,25 @@ libnet_diag_dump_pblock_type(u_int8_t type); * @param stream a stream pointer to print to */ void -libnet_diag_dump_hex(u_int8_t *packet, u_int32_t len, int swap, FILE *stream); +libnet_diag_dump_hex(uint8_t *packet, uint32_t len, int swap, FILE *stream); /* * [Internal] */ int -libnet_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t size); +libnet_write_raw_ipv4(libnet_t *l, uint8_t *packet, uint32_t size); /* * [Internal] */ int -libnet_write_raw_ipv6(libnet_t *l, u_int8_t *packet, u_int32_t size); +libnet_write_raw_ipv6(libnet_t *l, uint8_t *packet, uint32_t size); /* * [Internal] */ int -libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size); +libnet_write_link(libnet_t *l, uint8_t *packet, uint32_t size); #if ((__WIN32__) && !(__CYGWIN__)) /* @@ -2132,25 +2132,25 @@ libnet_close_link(libnet_t *l); * [Internal] */ int -libnet_do_checksum(libnet_t *l, u_int8_t *packet, int protocol, int len); +libnet_do_checksum(libnet_t *l, uint8_t *packet, int protocol, int len); /* * [Internal] */ -u_int32_t -libnet_compute_crc(u_int8_t *buf, u_int32_t len); +uint32_t +libnet_compute_crc(uint8_t *buf, uint32_t len); /* * [Internal] */ -u_int16_t -libnet_ip_check(u_int16_t *addr, int len); +uint16_t +libnet_ip_check(uint16_t *addr, int len); /* * [Internal] */ int -libnet_in_cksum(u_int16_t *addr, int len); +libnet_in_cksum(uint16_t *addr, int len); /* * [Internal] @@ -2160,8 +2160,8 @@ libnet_in_cksum(u_int16_t *addr, int len); * and return a pointer to it. */ libnet_pblock_t * -libnet_pblock_probe(libnet_t *l, libnet_ptag_t ptag, u_int32_t n, -u_int8_t type); +libnet_pblock_probe(libnet_t *l, libnet_ptag_t ptag, uint32_t n, +uint8_t type); /* * [Internal] @@ -2169,7 +2169,7 @@ u_int8_t type); * an entry to the doubly linked list. */ libnet_pblock_t * -libnet_pblock_new(libnet_t *l, u_int32_t size); +libnet_pblock_new(libnet_t *l, uint32_t size); /* * [Internal] @@ -2200,8 +2200,8 @@ libnet_pblock_delete(libnet_t *l, libnet_pblock_t *p); * pblock has a succesively increasing ptag identifier. */ libnet_ptag_t -libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, u_int32_t h, -u_int8_t type); +libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, uint32_t h, +uint8_t type); /* @@ -2227,15 +2227,15 @@ libnet_pblock_find(libnet_t *l, libnet_ptag_t ptag); * Function copies protocol block data over. */ int -libnet_pblock_append(libnet_t *l, libnet_pblock_t *p, u_int8_t *buf, -u_int32_t len); +libnet_pblock_append(libnet_t *l, libnet_pblock_t *p, uint8_t *buf, +uint32_t len); /* * [Internal] * Function sets pblock flags. */ void -libnet_pblock_setflags(libnet_pblock_t *p, u_int8_t flags); +libnet_pblock_setflags(libnet_pblock_t *p, uint8_t flags); /* * [Internal] @@ -2243,7 +2243,7 @@ libnet_pblock_setflags(libnet_pblock_t *p, u_int8_t flags); * the type is unknown, the function defaults to returning IPPROTO_IP. */ int -libnet_pblock_p2p(u_int8_t type); +libnet_pblock_p2p(uint8_t type); /* * [Internal] @@ -2251,7 +2251,7 @@ libnet_pblock_p2p(u_int8_t type); * passes through the pblock list: */ int -libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size); +libnet_pblock_coalesce(libnet_t *l, uint8_t **packet, uint32_t *size); #if !(__WIN32__) /* diff --git a/libnet/include/libnet/libnet-headers.h b/libnet/include/libnet/libnet-headers.h index 92c17bb..37b35dd 100644 --- a/libnet/include/libnet/libnet-headers.h +++ b/libnet/include/libnet/libnet-headers.h @@ -113,14 +113,14 @@ */ struct libnet_802_1q_hdr { - u_int8_t vlan_dhost[ETHER_ADDR_LEN]; /**< destination ethernet address */ - u_int8_t vlan_shost[ETHER_ADDR_LEN]; /**< source ethernet address */ - u_int16_t vlan_tpi; /**< tag protocol ID */ - u_int16_t vlan_priority_c_vid; /**< priority | VLAN ID */ + uint8_t vlan_dhost[ETHER_ADDR_LEN]; /**< destination ethernet address */ + uint8_t vlan_shost[ETHER_ADDR_LEN]; /**< source ethernet address */ + uint16_t vlan_tpi; /**< tag protocol ID */ + uint16_t vlan_priority_c_vid; /**< priority | VLAN ID */ #define LIBNET_802_1Q_PRIMASK 0x0007 /**< priority mask */ #define LIBNET_802_1Q_CFIMASK 0x0001 /**< CFI mask */ #define LIBNET_802_1Q_VIDMASK 0x0fff /**< vid mask */ - u_int16_t vlan_len; /**< length or type (802.3 / Eth 2) */ + uint16_t vlan_len; /**< length or type (802.3 / Eth 2) */ }; /* @@ -129,14 +129,14 @@ struct libnet_802_1q_hdr */ struct libnet_802_1x_hdr { - u_int8_t dot1x_version; /**< protocol version */ - u_int8_t dot1x_type; /**< frame type */ + uint8_t dot1x_version; /**< protocol version */ + uint8_t dot1x_type; /**< frame type */ #define LIBNET_802_1X_PACKET 0x00 /**< 802.1x packet */ #define LIBNET_802_1X_START 0x01 /**< 802.1x start */ #define LIBNET_802_1X_LOGOFF 0x02 /**< 802.1x logoff */ #define LIBNET_802_1X_KEY 0x03 /**< 802.1x key */ #define LIBNET_802_1X_ENCASFAL 0x04 /**< 802.1x encasfal */ - u_int16_t dot1x_length; /**< total frame length */ + uint16_t dot1x_length; /**< total frame length */ }; /* @@ -146,11 +146,11 @@ struct libnet_802_1x_hdr */ struct libnet_802_2_hdr { - u_int8_t llc_dsap; /* destination service access point */ - u_int8_t llc_ssap; /* source service access point */ + uint8_t llc_dsap; /* destination service access point */ + uint8_t llc_ssap; /* source service access point */ #define LIBNET_SAP_STP 0x42 #define LIBNET_SAP_SNAP 0xaa - u_int8_t llc_control; /* control field */ + uint8_t llc_control; /* control field */ }; @@ -161,11 +161,11 @@ struct libnet_802_2_hdr */ struct libnet_802_2snap_hdr { - u_int8_t snap_dsap; /* destination service access point */ - u_int8_t snap_ssap; /* destination service access point */ - u_int8_t snap_control; /* control field */ - u_int8_t snap_oui[3]; /* OUI */ - u_int16_t snap_type; /* type */ + uint8_t snap_dsap; /* destination service access point */ + uint8_t snap_ssap; /* destination service access point */ + uint8_t snap_control; /* control field */ + uint8_t snap_oui[3]; /* OUI */ + uint16_t snap_type; /* type */ }; @@ -176,9 +176,9 @@ struct libnet_802_2snap_hdr */ struct libnet_802_3_hdr { - u_int8_t _802_3_dhost[ETHER_ADDR_LEN];/* destination ethernet address */ - u_int8_t _802_3_shost[ETHER_ADDR_LEN];/* source ethernet address */ - u_int16_t _802_3_len; /* packet type ID */ + uint8_t _802_3_dhost[ETHER_ADDR_LEN];/* destination ethernet address */ + uint8_t _802_3_shost[ETHER_ADDR_LEN];/* source ethernet address */ + uint16_t _802_3_len; /* packet type ID */ }; @@ -189,7 +189,7 @@ struct libnet_802_3_hdr */ struct libnet_arp_hdr { - u_int16_t ar_hrd; /* format of hardware address */ + uint16_t ar_hrd; /* format of hardware address */ #define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ #define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ #define ARPHRD_EETHER 2 /* Experimental Ethernet */ @@ -204,10 +204,10 @@ struct libnet_arp_hdr #define ARPHRD_ATM 19 /* ATM */ #define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */ #define ARPHRD_IPSEC 31 /* IPsec tunnel */ - u_int16_t ar_pro; /* format of protocol address */ - u_int8_t ar_hln; /* length of hardware address */ - u_int8_t ar_pln; /* length of protocol addres */ - u_int16_t ar_op; /* operation type */ + uint16_t ar_pro; /* format of protocol address */ + uint8_t ar_hln; /* length of hardware address */ + uint8_t ar_pln; /* length of protocol addres */ + uint16_t ar_op; /* operation type */ #define ARPOP_REQUEST 1 /* req to resolve address */ #define ARPOP_REPLY 2 /* resp to previous request */ #define ARPOP_REVREQUEST 3 /* req protocol address given hardware */ @@ -225,9 +225,9 @@ struct libnet_arp_hdr struct libnet_bgp4_header_hdr { #define LIBNET_BGP4_MARKER_SIZE 16 - u_int8_t marker[LIBNET_BGP4_MARKER_SIZE]; - u_int16_t len; - u_int8_t type; + uint8_t marker[LIBNET_BGP4_MARKER_SIZE]; + uint16_t len; + uint8_t type; #define LIBNET_BGP4_OPEN 1 #define LIBNET_BGP4_UPDATE 2 #define LIBNET_BGP4_NOTIFICATION 3 @@ -241,11 +241,11 @@ struct libnet_bgp4_header_hdr */ struct libnet_bgp4_open_hdr { - u_int8_t version; - u_int16_t src_as; - u_int16_t hold_time; - u_int32_t bgp_id; - u_int8_t opt_len; + uint8_t version; + uint16_t src_as; + uint16_t hold_time; + uint32_t bgp_id; + uint8_t opt_len; }; /* @@ -264,7 +264,7 @@ struct libnet_bgp4_notification_hdr #define LIBNET_BGP4_HOLD_TIMER_EXPIRED 4 #define LIBNET_BGP4_FINITE_STATE__ERROR 5 #define LIBNET_BGP4_CEASE 6 - u_int8_t err_code; + uint8_t err_code; /* Message Header Error subcodes */ #define LIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED 1 @@ -289,7 +289,7 @@ struct libnet_bgp4_notification_hdr #define LIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR #define LIBNET_BGP4_INVALID_NETWORK_FIELD #define LIBNET_BGP4_MALFORMED_AS_PATH - u_int8_t err_subcode; + uint8_t err_subcode; }; @@ -307,10 +307,10 @@ struct libnet_bgp4_notification_hdr */ struct libnet_cdp_hdr { - u_int8_t cdp_version; /* version (should always be 0x01) */ - u_int8_t cdp_ttl; /* time reciever should hold info in this packet */ - u_int16_t cdp_sum; /* checksum */ - u_int16_t cdp_type; /* type */ + uint8_t cdp_version; /* version (should always be 0x01) */ + uint8_t cdp_ttl; /* time reciever should hold info in this packet */ + uint16_t cdp_sum; /* checksum */ + uint16_t cdp_type; /* type */ #define LIBNET_CDP_DEVID 0x1 /* device id */ #define LIBNET_CDP_ADDRESS 0x2 /* address */ #define LIBNET_CDP_PORTID 0x3 /* port id */ @@ -318,7 +318,7 @@ struct libnet_cdp_hdr #define LIBNET_CDP_VERSION 0x5 /* version */ #define LIBNET_CDP_PLATFORM 0x6 /* platform */ #define LIBNET_CDP_IPPREFIX 0x7 /* ip prefix */ - u_int16_t cdp_len; /* type + length + value */ + uint16_t cdp_len; /* type + length + value */ /* value information done dynamically */ /* CDP capabilities */ @@ -337,8 +337,8 @@ struct libnet_cdp_hdr */ struct libnet_cdp_value_hdr { - u_int16_t cdp_type; - u_int16_t cdp_len; + uint16_t cdp_type; + uint16_t cdp_len; }; @@ -349,23 +349,23 @@ struct libnet_cdp_value_hdr */ struct libnet_dhcpv4_hdr { - u_int8_t dhcp_opcode; /* opcode */ + uint8_t dhcp_opcode; /* opcode */ #define LIBNET_DHCP_REQUEST 0x1 #define LIBNET_DHCP_REPLY 0x2 - u_int8_t dhcp_htype; /* hardware address type */ - u_int8_t dhcp_hlen; /* hardware address length */ - u_int8_t dhcp_hopcount; /* used by proxy servers */ - u_int32_t dhcp_xid; /* transaction ID */ - u_int16_t dhcp_secs; /* number of seconds since trying to bootstrap */ - u_int16_t dhcp_flags; /* flags for DHCP, unused for BOOTP */ - u_int32_t dhcp_cip; /* client's IP */ - u_int32_t dhcp_yip; /* your IP */ - u_int32_t dhcp_sip; /* server's IP */ - u_int32_t dhcp_gip; /* gateway IP */ - u_int8_t dhcp_chaddr[16]; /* client hardware address */ - u_int8_t dhcp_sname[64]; /* server host name */ - u_int8_t dhcp_file[128]; /* boot file name */ - u_int32_t dhcp_magic; /* BOOTP magic header */ + uint8_t dhcp_htype; /* hardware address type */ + uint8_t dhcp_hlen; /* hardware address length */ + uint8_t dhcp_hopcount; /* used by proxy servers */ + uint32_t dhcp_xid; /* transaction ID */ + uint16_t dhcp_secs; /* number of seconds since trying to bootstrap */ + uint16_t dhcp_flags; /* flags for DHCP, unused for BOOTP */ + uint32_t dhcp_cip; /* client's IP */ + uint32_t dhcp_yip; /* your IP */ + uint32_t dhcp_sip; /* server's IP */ + uint32_t dhcp_gip; /* gateway IP */ + uint8_t dhcp_chaddr[16]; /* client hardware address */ + uint8_t dhcp_sname[64]; /* server host name */ + uint8_t dhcp_file[128]; /* boot file name */ + uint32_t dhcp_magic; /* BOOTP magic header */ #define DHCP_MAGIC 0x63825363 #define LIBNET_BOOTP_MIN_LEN 0x12c #define LIBNET_DHCP_PAD 0x00 @@ -463,24 +463,24 @@ struct libnet_dhcpv4_hdr */ struct libnet_dnsv4_hdr { - u_int16_t h_len; /* length of the packet - only used with TCP */ - u_int16_t id; /* DNS packet ID */ - u_int16_t flags; /* DNS flags */ - u_int16_t num_q; /* Number of questions */ - u_int16_t num_answ_rr; /* Number of answer resource records */ - u_int16_t num_auth_rr; /* Number of authority resource records */ - u_int16_t num_addi_rr; /* Number of additional resource records */ + uint16_t h_len; /* length of the packet - only used with TCP */ + uint16_t id; /* DNS packet ID */ + uint16_t flags; /* DNS flags */ + uint16_t num_q; /* Number of questions */ + uint16_t num_answ_rr; /* Number of answer resource records */ + uint16_t num_auth_rr; /* Number of authority resource records */ + uint16_t num_addi_rr; /* Number of additional resource records */ }; #define LIBNET_DNS_H LIBNET_UDP_DNSV4_H struct libnet_dnsv4udp_hdr { - u_int16_t id; /* DNS packet ID */ - u_int16_t flags; /* DNS flags */ - u_int16_t num_q; /* Number of questions */ - u_int16_t num_answ_rr; /* Number of answer resource records */ - u_int16_t num_auth_rr; /* Number of authority resource records */ - u_int16_t num_addi_rr; /* Number of additional resource records */ + uint16_t id; /* DNS packet ID */ + uint16_t flags; /* DNS flags */ + uint16_t num_q; /* Number of questions */ + uint16_t num_answ_rr; /* Number of answer resource records */ + uint16_t num_auth_rr; /* Number of authority resource records */ + uint16_t num_addi_rr; /* Number of additional resource records */ }; /* @@ -489,9 +489,9 @@ struct libnet_dnsv4udp_hdr */ struct libnet_ethernet_hdr { - u_int8_t ether_dhost[ETHER_ADDR_LEN];/* destination ethernet address */ - u_int8_t ether_shost[ETHER_ADDR_LEN];/* source ethernet address */ - u_int16_t ether_type; /* protocol */ + uint8_t ether_dhost[ETHER_ADDR_LEN];/* destination ethernet address */ + uint8_t ether_shost[ETHER_ADDR_LEN];/* source ethernet address */ + uint16_t ether_type; /* protocol */ }; #ifndef ETHERTYPE_PUP @@ -521,7 +521,7 @@ struct libnet_ethernet_hdr struct libnet_ether_addr { - u_int8_t ether_addr_octet[6]; /* Ethernet address */ + uint8_t ether_addr_octet[6]; /* Ethernet address */ }; /* @@ -531,22 +531,22 @@ struct libnet_ether_addr * * Note: Organization field is 3 bytes which throws off the * alignment of type. Therefore fddi_type (19 bytes in) - * is specified as two u_int8_ts. + * is specified as two uint8_ts. */ struct libnet_fddi_hdr { - u_int8_t fddi_frame_control; /* Class/Format/Priority */ + uint8_t fddi_frame_control; /* Class/Format/Priority */ #define LIBNET_FDDI_LLC_FRAME 0x10 #define LIBNET_FDDI_48BIT_ADDR 0x40 #define LIBNET_FDDI_FC_REQD LIBNET_FDDI_LLC_FRAME | LIBNET_FDDI_48BIT_ADDR - u_int8_t fddi_dhost[FDDI_ADDR_LEN]; /* destination fddi address */ - u_int8_t fddi_shost[FDDI_ADDR_LEN]; /* source fddi address */ - u_int8_t fddi_llc_dsap; /* DSAP */ - u_int8_t fddi_llc_ssap; /* SSAP */ - u_int8_t fddi_llc_control_field; /* Class/Format/Priority */ - u_int8_t fddi_llc_org_code[LIBNET_ORG_CODE_SIZE]; /* Organization Code 3-bytes */ - u_int8_t fddi_type; /* Protocol Type */ - u_int8_t fddi_type1; /* see note above. */ + uint8_t fddi_dhost[FDDI_ADDR_LEN]; /* destination fddi address */ + uint8_t fddi_shost[FDDI_ADDR_LEN]; /* source fddi address */ + uint8_t fddi_llc_dsap; /* DSAP */ + uint8_t fddi_llc_ssap; /* SSAP */ + uint8_t fddi_llc_control_field; /* Class/Format/Priority */ + uint8_t fddi_llc_org_code[LIBNET_ORG_CODE_SIZE]; /* Organization Code 3-bytes */ + uint8_t fddi_type; /* Protocol Type */ + uint8_t fddi_type1; /* see note above. */ #define FDDI_TYPE_IP 0x0800 /* IP protocol */ #define FDDI_TYPE_ARP 0x0806 /* addr. resolution protocol */ #define FDDI_TYPE_REVARP 0x8035 /* reverse addr. resolution protocol */ @@ -555,7 +555,7 @@ struct libnet_fddi_hdr struct libnet_fddi_addr { - u_int8_t fddi_addr_octet[6]; /* FDDI address */ + uint8_t fddi_addr_octet[6]; /* FDDI address */ }; @@ -566,7 +566,7 @@ struct libnet_fddi_addr */ struct libnet_gre_hdr { - u_int16_t flags_ver; + uint16_t flags_ver; #define GRE_CSUM 0x8000 #define GRE_ROUTING 0x4000 #define GRE_KEY 0x2000 @@ -581,7 +581,7 @@ struct libnet_gre_hdr #define GRE_VERSION_0 0x0000 #define GRE_VERSION_1 0x0001 - u_int16_t type; + uint16_t type; #define GRE_SNA 0x0004 #define GRE_OSI_NETWORK_LAYER 0x00FE #define GRE_PUP 0x0200 @@ -606,17 +606,17 @@ struct libnet_gre_hdr union { struct { - u_int16_t sum; /* optional */ - u_int16_t offset; /* optional */ - u_int32_t key; /* optional */ - u_int32_t seq; /* optional */ + uint16_t sum; /* optional */ + uint16_t offset; /* optional */ + uint32_t key; /* optional */ + uint32_t seq; /* optional */ } _gre; struct { - u_int16_t payload_s; /* optional */ - u_int16_t callID; /* optional */ - u_int32_t seq; /* optional */ - u_int32_t ack; /* optional */ + uint16_t payload_s; /* optional */ + uint16_t callID; /* optional */ + uint32_t seq; /* optional */ + uint32_t ack; /* optional */ } _egre; }_data; @@ -643,10 +643,10 @@ struct libnet_gre_hdr */ struct libnet_gre_sre_hdr { - u_int16_t af; /* address familly */ - u_int8_t sre_offset; - u_int8_t sre_length; - u_int8_t *routing; + uint16_t af; /* address familly */ + uint8_t sre_offset; + uint8_t sre_length; + uint8_t *routing; }; @@ -658,14 +658,14 @@ struct libnet_gre_sre_hdr struct libnet_ipv4_hdr { #if (LIBNET_LIL_ENDIAN) - u_int8_t ip_hl:4, /* header length */ + uint8_t ip_hl:4, /* header length */ ip_v:4; /* version */ #endif #if (LIBNET_BIG_ENDIAN) - u_int8_t ip_v:4, /* version */ + uint8_t ip_v:4, /* version */ ip_hl:4; /* header length */ #endif - u_int8_t ip_tos; /* type of service */ + uint8_t ip_tos; /* type of service */ #ifndef IPTOS_LOWDELAY #define IPTOS_LOWDELAY 0x10 #endif @@ -678,9 +678,9 @@ struct libnet_ipv4_hdr #ifndef IPTOS_LOWCOST #define IPTOS_LOWCOST 0x02 #endif - u_int16_t ip_len; /* total length */ - u_int16_t ip_id; /* identification */ - u_int16_t ip_off; + uint16_t ip_len; /* total length */ + uint16_t ip_id; /* identification */ + uint16_t ip_off; #ifndef IP_RF #define IP_RF 0x8000 /* reserved fragment flag */ #endif @@ -693,9 +693,9 @@ struct libnet_ipv4_hdr #ifndef IP_OFFMASK #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ #endif - u_int8_t ip_ttl; /* time to live */ - u_int8_t ip_p; /* protocol */ - u_int16_t ip_sum; /* checksum */ + uint8_t ip_ttl; /* time to live */ + uint8_t ip_p; /* protocol */ + uint16_t ip_sum; /* checksum */ struct in_addr ip_src, ip_dst; /* source and dest address */ }; @@ -734,9 +734,9 @@ struct libnet_in6_addr { union { - u_int8_t __u6_addr8[16]; - u_int16_t __u6_addr16[8]; - u_int32_t __u6_addr32[4]; + uint8_t __u6_addr8[16]; + uint16_t __u6_addr16[8]; + uint32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ }; #define libnet_s6_addr __u6_addr.__u6_addr8 @@ -748,10 +748,10 @@ struct libnet_in6_addr */ struct libnet_ipv6_hdr { - u_int8_t ip_flags[4]; /* version, traffic class, flow label */ - u_int16_t ip_len; /* total length */ - u_int8_t ip_nh; /* next header */ - u_int8_t ip_hl; /* hop limit */ + uint8_t ip_flags[4]; /* version, traffic class, flow label */ + uint16_t ip_len; /* total length */ + uint8_t ip_nh; /* next header */ + uint8_t ip_hl; /* hop limit */ struct libnet_in6_addr ip_src, ip_dst; /* source and dest address */ }; @@ -764,10 +764,10 @@ struct libnet_ipv6_hdr #define LIBNET_IPV6_NH_FRAGMENT 44 struct libnet_ipv6_frag_hdr { - u_int8_t ip_nh; /* next header */ - u_int8_t ip_reserved; /* reserved */ - u_int16_t ip_frag; /* fragmentation stuff */ - u_int32_t ip_id; /* id */ + uint8_t ip_nh; /* next header */ + uint8_t ip_reserved; /* reserved */ + uint16_t ip_frag; /* fragmentation stuff */ + uint32_t ip_id; /* id */ }; /* @@ -778,10 +778,10 @@ struct libnet_ipv6_frag_hdr #define LIBNET_IPV6_NH_ROUTING 43 struct libnet_ipv6_routing_hdr { - u_int8_t ip_nh; /* next header */ - u_int8_t ip_len; /* length of header in 8 octet units (sans 1st) */ - u_int8_t ip_rtype; /* routing type */ - u_int8_t ip_segments; /* segments left */ + uint8_t ip_nh; /* next header */ + uint8_t ip_len; /* length of header in 8 octet units (sans 1st) */ + uint8_t ip_rtype; /* routing type */ + uint8_t ip_segments; /* segments left */ /* routing information allocated dynamically */ }; @@ -793,8 +793,8 @@ struct libnet_ipv6_routing_hdr #define LIBNET_IPV6_NH_DESTOPTS 60 struct libnet_ipv6_destopts_hdr { - u_int8_t ip_nh; /* next header */ - u_int8_t ip_len; /* length of header in 8 octet units (sans 1st) */ + uint8_t ip_nh; /* next header */ + uint8_t ip_len; /* length of header in 8 octet units (sans 1st) */ /* destination options information allocated dynamically */ }; @@ -806,8 +806,8 @@ struct libnet_ipv6_destopts_hdr #define LIBNET_IPV6_NH_HBH 0 struct libnet_ipv6_hbhopts_hdr { - u_int8_t ip_nh; /* next header */ - u_int8_t ip_len; /* length of header in 8 octet units (sans 1st) */ + uint8_t ip_nh; /* next header */ + uint8_t ip_len; /* length of header in 8 octet units (sans 1st) */ /* destination options information allocated dynamically */ }; @@ -821,7 +821,7 @@ struct libnet_ipv6_hbhopts_hdr #endif struct libnet_icmpv6_hdr { - u_int8_t icmp_type; /* ICMP type */ + uint8_t icmp_type; /* ICMP type */ #ifndef ICMP6_ECHO #define ICMP6_ECHO 128 #endif @@ -840,10 +840,10 @@ struct libnet_icmpv6_hdr #ifndef ICMP6_PARAMPROB #define ICMP6_PARAMPROB 4 #endif - u_int8_t icmp_code; /* ICMP code */ - u_int16_t icmp_sum; /* ICMP Checksum */ - u_int16_t id; /* ICMP id */ - u_int16_t seq; /* ICMP sequence number */ + uint8_t icmp_code; /* ICMP code */ + uint16_t icmp_sum; /* ICMP Checksum */ + uint16_t id; /* ICMP id */ + uint16_t seq; /* ICMP sequence number */ }; @@ -855,7 +855,7 @@ struct libnet_icmpv6_hdr */ struct libnet_icmpv4_hdr { - u_int8_t icmp_type; /* ICMP type */ + uint8_t icmp_type; /* ICMP type */ #ifndef ICMP_ECHOREPLY #define ICMP_ECHOREPLY 0 #endif @@ -901,7 +901,7 @@ struct libnet_icmpv4_hdr #ifndef ICMP_MASKREPLY #define ICMP_MASKREPLY 18 #endif - u_int8_t icmp_code; /* ICMP code */ + uint8_t icmp_code; /* ICMP code */ #ifndef ICMP_UNREACH_NET #define ICMP_UNREACH_NET 0 #endif @@ -972,14 +972,14 @@ struct libnet_icmpv4_hdr #define ICMP_PARAMPROB_OPTABSENT 1 #endif - u_int16_t icmp_sum; /* ICMP Checksum */ + uint16_t icmp_sum; /* ICMP Checksum */ union { struct { - u_int16_t id; /* ICMP id */ - u_int16_t seq;/* ICMP sequence number */ + uint16_t id; /* ICMP id */ + uint16_t seq;/* ICMP sequence number */ } echo; #undef icmp_id @@ -987,11 +987,11 @@ struct libnet_icmpv4_hdr #define icmp_id hun.echo.id #define icmp_seq hun.echo.seq - u_int32_t gateway; /* gateway host */ + uint32_t gateway; /* gateway host */ struct { - u_int16_t pad;/* padding */ - u_int16_t mtu;/* MTU size */ + uint16_t pad;/* padding */ + uint16_t mtu;/* MTU size */ } frag; } hun; union @@ -1007,7 +1007,7 @@ struct libnet_icmpv4_hdr struct libnet_ipv4_hdr idi_ip; /* options and then 64 bits of data */ } ip; - u_int32_t mask; + uint32_t mask; int8_t data[1]; #undef icmp_mask @@ -1032,7 +1032,7 @@ struct libnet_icmpv4_hdr */ struct libnet_igmp_hdr { - u_int8_t igmp_type; /* IGMP type */ + uint8_t igmp_type; /* IGMP type */ #ifndef IGMP_MEMBERSHIP_QUERY #define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */ #endif @@ -1045,8 +1045,8 @@ struct libnet_igmp_hdr #ifndef IGMP_LEAVE_GROUP #define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */ #endif - u_int8_t igmp_code; /* IGMP code */ - u_int16_t igmp_sum; /* IGMP checksum */ + uint8_t igmp_code; /* IGMP code */ + uint16_t igmp_sum; /* IGMP checksum */ struct in_addr igmp_group;/* IGMP host IP */ }; @@ -1063,15 +1063,15 @@ struct libnet_igmp_hdr #endif struct libnet_esp_hdr { - u_int32_t esp_spi; /* security parameter index */ - u_int32_t esp_seq; /* ESP sequence number */ - u_int32_t esp_iv; /* initialization vector */ + uint32_t esp_spi; /* security parameter index */ + uint32_t esp_seq; /* ESP sequence number */ + uint32_t esp_iv; /* initialization vector */ }; struct libnet_esp_ftr { - u_int8_t esp_pad_len; /* padding length */ - u_int8_t esp_nh; /* next header pointer */ + uint8_t esp_pad_len; /* padding length */ + uint8_t esp_nh; /* next header pointer */ int8_t *esp_auth; /* authentication data */ }; @@ -1080,12 +1080,12 @@ struct libnet_esp_ftr #endif struct libnet_ah_hdr { - u_int8_t ah_nh; /* next header */ - u_int8_t ah_len; /* payload length */ - u_int16_t ah_res; /* reserved */ - u_int32_t ah_spi; /* security parameter index */ - u_int32_t ah_seq; /* AH sequence number */ - u_int32_t ah_auth; /* authentication data */ + uint8_t ah_nh; /* next header */ + uint8_t ah_len; /* payload length */ + uint16_t ah_res; /* reserved */ + uint32_t ah_spi; /* security parameter index */ + uint32_t ah_seq; /* AH sequence number */ + uint32_t ah_auth; /* authentication data */ }; @@ -1101,21 +1101,21 @@ struct libnet_ah_hdr */ struct libnet_isl_hdr { - u_int8_t isl_dhost[5]; /* destination address "01:00:0c:00:00" */ + uint8_t isl_dhost[5]; /* destination address "01:00:0c:00:00" */ #if (LIBNET_LIL_ENDIAN) - u_int8_t isl_type:4, /* type of frame */ + uint8_t isl_type:4, /* type of frame */ isl_user:4; /* user defined bits */ #endif #if (LIBNET_BIG_ENDIAN) - u_int8_t isl_user:4, /* user defined bits */ + uint8_t isl_user:4, /* user defined bits */ isl_type:4; /* type of frame */ #endif - u_int8_t isl_shost[6]; /* source address */ - u_int16_t isl_len; /* total length of packet - 18 bytes */ - u_int8_t isl_snap[6]; /* 0xaaaa03 + vendor code */ - u_int16_t isl_vid; /* 15 bit VLAN ID, 1 bit BPDU / CDP indicator */ - u_int16_t isl_index; /* port index */ - u_int16_t isl_reserved; /* used for FDDI and token ring */ + uint8_t isl_shost[6]; /* source address */ + uint16_t isl_len; /* total length of packet - 18 bytes */ + uint8_t isl_snap[6]; /* 0xaaaa03 + vendor code */ + uint16_t isl_vid; /* 15 bit VLAN ID, 1 bit BPDU / CDP indicator */ + uint16_t isl_index; /* port index */ + uint16_t isl_reserved; /* used for FDDI and token ring */ /* ethernet frame and 4 byte isl crc */ }; @@ -1143,7 +1143,7 @@ struct libnet_isl_hdr */ struct libnet_mpls_hdr { - u_int32_t mpls_les; /* 20 bits label, 3 bits exp, 1 bit bos, ttl */ + uint32_t mpls_les; /* 20 bits label, 3 bits exp, 1 bit bos, ttl */ #define LIBNET_MPLS_BOS_ON 1 #define LIBNET_MPLS_BOS_OFF 0 }; @@ -1155,20 +1155,20 @@ struct libnet_mpls_hdr */ struct libnet_ntp_hdr_l_fp /* int32_t floating point (64-bit) */ { - u_int32_t integer; /* integer */ - u_int32_t fraction; /* fraction */ + uint32_t integer; /* integer */ + uint32_t fraction; /* fraction */ }; struct libnet_ntp_hdr_s_fp /* int16_t floating point (32-bit) */ { - u_int16_t integer; /* integer */ - u_int16_t fraction; /* fraction */ + uint16_t integer; /* integer */ + uint16_t fraction; /* fraction */ }; struct libnet_ntp_hdr { - u_int8_t ntp_li_vn_mode; /* leap indicator, version, mode */ + uint8_t ntp_li_vn_mode; /* leap indicator, version, mode */ #define LIBNET_NTP_LI_NW 0x0 /* no warning */ #define LIBNET_NTP_LI_AS 0x1 /* last minute has 61 seconds */ #define LIBNET_NTP_LI_DS 0x2 /* last minute has 59 seconds */ @@ -1186,16 +1186,16 @@ struct libnet_ntp_hdr #define LIBNET_NTP_MODE_B 0x5 /* broadcast */ #define LIBNET_NTP_MODE_RC 0x6 /* reserved for NTP control message */ #define LIBNET_NTP_MODE_RP 0x7 /* reserved for private use */ - u_int8_t ntp_stratum; /* stratum */ + uint8_t ntp_stratum; /* stratum */ #define LIBNET_NTP_STRATUM_UNAVAIL 0x0 /* unspecified or unavailable */ #define LIBNET_NTP_STRATUM_PRIMARY 0x1 /* primary reference (radio clock) */ /* 2 - 15 is secondary */ /* 16 - 255 is reserved */ - u_int8_t ntp_poll; /* poll interval (should be 4 - 12) */ - u_int8_t ntp_precision; /* local clock precision */ + uint8_t ntp_poll; /* poll interval (should be 4 - 12) */ + uint8_t ntp_precision; /* local clock precision */ struct libnet_ntp_hdr_s_fp ntp_delay; /* roundtrip delay */ struct libnet_ntp_hdr_s_fp ntp_dispersion; /* nominal error */ - u_int32_t ntp_reference_id; /* reference source id */ + uint32_t ntp_reference_id; /* reference source id */ #define LIBNET_NTP_REF_LOCAL 0x4c4f434c /* uncalibrated local clock */ #define LIBNET_NTP_REF_PPS 0x50505300 /* atomic / pulse-per-second clock */ #define LIBNET_NTP_REF_ACTS 0x41435453 /* NIST dialup modem */ @@ -1226,20 +1226,20 @@ struct libnet_ntp_hdr */ struct libnet_ospf_hdr { - u_int8_t ospf_v; /* version */ + uint8_t ospf_v; /* version */ #define OSPFVERSION 2 - u_int8_t ospf_type; /* type */ + uint8_t ospf_type; /* type */ #define LIBNET_OSPF_UMD 0 /* UMd monitoring packet */ #define LIBNET_OSPF_HELLO 1 /* HELLO packet */ #define LIBNET_OSPF_DBD 2 /* dataBase description packet */ #define LIBNET_OSPF_LSR 3 /* link state request packet */ #define LIBNET_OSPF_LSU 4 /* link state Update Packet */ #define LIBNET_OSPF_LSA 5 /* link state acknowledgement packet */ - u_int16_t ospf_len; /* length */ + uint16_t ospf_len; /* length */ struct in_addr ospf_rtr_id; /* source router ID */ struct in_addr ospf_area_id;/* roam ID */ - u_int16_t ospf_sum; /* checksum */ - u_int16_t ospf_auth_type; /* authentication type */ + uint16_t ospf_sum; /* checksum */ + uint16_t ospf_auth_type; /* authentication type */ #define LIBNET_OSPF_AUTH_NULL 0 /* null password */ #define LIBNET_OSPF_AUTH_SIMPLE 1 /* simple, plaintext, 8 int8_t password */ #define LIBNET_OSPF_AUTH_MD5 2 /* MD5 */ @@ -1253,10 +1253,10 @@ struct libnet_ospf_hdr */ struct libnet_auth_hdr { - u_int16_t ospf_auth_null; /* NULL */ - u_int8_t ospf_auth_keyid; /* authentication key ID */ - u_int8_t ospf_auth_len; /* auth data length */ - u_int ospf_auth_seq; /* cryptographic sequence number */ + uint16_t ospf_auth_null; /* NULL */ + uint8_t ospf_auth_keyid; /* authentication key ID */ + uint8_t ospf_auth_len; /* auth data length */ + uint ospf_auth_seq; /* cryptographic sequence number */ }; @@ -1268,10 +1268,10 @@ struct libnet_auth_hdr struct libnet_ospf_hello_hdr { struct in_addr hello_nmask; /* netmask associated with the interface */ - u_int16_t hello_intrvl; /* num of seconds between routers last packet */ - u_int8_t hello_opts; /* Options for HELLO packets (look above) */ - u_int8_t hello_rtr_pri; /* router's priority (if 0, can't be backup) */ - u_int hello_dead_intvl; /* # of secs a router is silent till deemed down */ + uint16_t hello_intrvl; /* num of seconds between routers last packet */ + uint8_t hello_opts; /* Options for HELLO packets (look above) */ + uint8_t hello_rtr_pri; /* router's priority (if 0, can't be backup) */ + uint hello_dead_intvl; /* # of secs a router is silent till deemed down */ struct in_addr hello_des_rtr; /* Designated router on the network */ struct in_addr hello_bkup_rtr; /* Backup router */ struct in_addr hello_nbr; /* neighbor router, memcpy more as needed */ @@ -1283,13 +1283,13 @@ struct libnet_ospf_hello_hdr */ struct libnet_dbd_hdr { - u_int16_t dbd_mtu_len; /* max length of IP dgram that this 'if' can use */ - u_int8_t dbd_opts; /* DBD packet options (from above) */ - u_int8_t dbd_type; /* type of exchange occurring */ + uint16_t dbd_mtu_len; /* max length of IP dgram that this 'if' can use */ + uint8_t dbd_opts; /* DBD packet options (from above) */ + uint8_t dbd_type; /* type of exchange occurring */ #define LIBNET_DBD_IBI 0x01 /* init */ #define LIBNET_DBD_MBIT 0x02 /* more DBD packets are to come */ #define LIBNET_DBD_MSBIT 0x04 /* If 1, sender is the master in the exchange */ - u_int dbd_seq; /* DBD sequence number */ + uint dbd_seq; /* DBD sequence number */ }; @@ -1308,8 +1308,8 @@ struct libnet_dbd_hdr */ struct libnet_lsr_hdr { - u_int lsr_type; /* type of LS being requested */ - u_int lsr_lsid; /* link state ID */ + uint lsr_type; /* type of LS being requested */ + uint lsr_lsid; /* link state ID */ struct in_addr lsr_adrtr; /* advertising router (memcpy more as needed) */ }; @@ -1319,7 +1319,7 @@ struct libnet_lsr_hdr */ struct libnet_lsu_hdr { - u_int lsu_num; /* number of LSAs that will be broadcasted */ + uint lsu_num; /* number of LSAs that will be broadcasted */ }; @@ -1328,14 +1328,14 @@ struct libnet_lsu_hdr */ struct libnet_lsa_hdr { - u_int16_t lsa_age; /* time in seconds since the LSA was originated */ - u_int8_t lsa_opts; /* look above for OPTS_* */ - u_int8_t lsa_type; /* look below for LS_TYPE_* */ - u_int lsa_id; /* link State ID */ + uint16_t lsa_age; /* time in seconds since the LSA was originated */ + uint8_t lsa_opts; /* look above for OPTS_* */ + uint8_t lsa_type; /* look below for LS_TYPE_* */ + uint lsa_id; /* link State ID */ struct in_addr lsa_adv; /* router ID of Advertising router */ - u_int lsa_seq; /* LSA sequence number to detect old/bad ones */ - u_int16_t lsa_sum; /* "Fletcher Checksum" of all fields minus age */ - u_int16_t lsa_len; /* length in bytes including the 20 byte header */ + uint lsa_seq; /* LSA sequence number to detect old/bad ones */ + uint16_t lsa_sum; /* "Fletcher Checksum" of all fields minus age */ + uint16_t lsa_len; /* length in bytes including the 20 byte header */ }; @@ -1347,23 +1347,23 @@ struct libnet_lsa_hdr */ struct libnet_rtr_lsa_hdr { - u_int16_t rtr_flags; /* set to help describe packet */ + uint16_t rtr_flags; /* set to help describe packet */ #define LIBNET_RTR_FLAGS_W 0x0100 /* W bit */ #define LIBNET_RTR_FLAGS_E 0x0200 /* E bit */ #define LIBNET_RTR_FLAGS_B 0x0400 /* B bit */ - u_int16_t rtr_num; /* number of links within that packet */ - u_int rtr_link_id; /* describes link_data (look below) */ + uint16_t rtr_num; /* number of links within that packet */ + uint rtr_link_id; /* describes link_data (look below) */ #define LIBNET_LINK_ID_NBR_ID 1 /* Neighbors router ID, also can be 4 */ #define LIBNET_LINK_ID_IP_DES 2 /* IP address of designated router */ #define LIBNET_LINK_ID_SUB 3 /* IP subnet number */ - u_int rtr_link_data; /* Depending on link_id, info is here */ - u_int8_t rtr_type; /* Description of router link */ + uint rtr_link_data; /* Depending on link_id, info is here */ + uint8_t rtr_type; /* Description of router link */ #define LIBNET_RTR_TYPE_PTP 1 /* Point-To-Point */ #define LIBNET_RTR_TYPE_TRANS 2 /* Connection to a "transit network" */ #define LIBNET_RTR_TYPE_STUB 3 /* Connectin to a "stub network" */ #define RTR_TYPE_VRTL 4 /* connects to a "virtual link" */ - u_int8_t rtr_tos_num; /* number of different TOS metrics for this link */ - u_int16_t rtr_metric; /* the "cost" of using this link */ + uint8_t rtr_tos_num; /* number of different TOS metrics for this link */ + uint16_t rtr_metric; /* the "cost" of using this link */ }; @@ -1373,7 +1373,7 @@ struct libnet_rtr_lsa_hdr struct libnet_net_lsa_hdr { struct in_addr net_nmask; /* Netmask for that network */ - u_int net_rtr_id; /* ID of router attached to that network */ + uint net_rtr_id; /* ID of router attached to that network */ }; @@ -1383,8 +1383,8 @@ struct libnet_net_lsa_hdr struct libnet_sum_lsa_hdr { struct in_addr sum_nmask; /* Netmask of destination IP address */ - u_int sum_metric; /* Same as in rtr_lsa (&0xfff to use last 24bit */ - u_int sum_tos_metric; /* first 8bits are TOS, 24bits are TOS Metric */ + uint sum_metric; /* Same as in rtr_lsa (&0xfff to use last 24bit */ + uint sum_tos_metric; /* first 8bits are TOS, 24bits are TOS Metric */ }; @@ -1395,10 +1395,10 @@ struct libnet_sum_lsa_hdr struct libnet_as_lsa_hdr { struct in_addr as_nmask; /* Netmask for advertised destination */ - u_int as_metric; /* May have to set E bit in first 8bits */ + uint as_metric; /* May have to set E bit in first 8bits */ #define LIBNET_AS_E_BIT_ON 0x80000000 /* as_metric */ struct in_addr as_fwd_addr; /* Forwarding address */ - u_int as_rte_tag; /* External route tag */ + uint as_rte_tag; /* External route tag */ }; @@ -1409,7 +1409,7 @@ struct libnet_as_lsa_hdr */ struct libnet_rip_hdr { - u_int8_t rip_cmd; /* RIP command */ + uint8_t rip_cmd; /* RIP command */ #define RIPCMD_REQUEST 1 /* want info */ #define RIPCMD_RESPONSE 2 /* responding to request */ #define RIPCMD_TRACEON 3 /* turn tracing on */ @@ -1417,17 +1417,17 @@ struct libnet_rip_hdr #define RIPCMD_POLL 5 /* like request, but anyone answers */ #define RIPCMD_POLLENTRY 6 /* like poll, but for entire entry */ #define RIPCMD_MAX 7 /* ? command */ - u_int8_t rip_ver; /* RIP version */ + uint8_t rip_ver; /* RIP version */ #define RIPVER_0 0 #define RIPVER_1 1 #define RIPVER_2 2 - u_int16_t rip_rd; /* Zero (v1) or Routing Domain (v2) */ - u_int16_t rip_af; /* Address family */ - u_int16_t rip_rt; /* Zero (v1) or Route Tag (v2) */ - u_int32_t rip_addr; /* IP address */ - u_int32_t rip_mask; /* Zero (v1) or Subnet Mask (v2) */ - u_int32_t rip_next_hop; /* Zero (v1) or Next hop IP address (v2) */ - u_int32_t rip_metric; /* Metric */ + uint16_t rip_rd; /* Zero (v1) or Routing Domain (v2) */ + uint16_t rip_af; /* Address family */ + uint16_t rip_rt; /* Zero (v1) or Route Tag (v2) */ + uint32_t rip_addr; /* IP address */ + uint32_t rip_mask; /* Zero (v1) or Subnet Mask (v2) */ + uint32_t rip_next_hop; /* Zero (v1) or Next hop IP address (v2) */ + uint32_t rip_metric; /* Metric */ }; /* @@ -1462,33 +1462,33 @@ struct libnet_rip_hdr struct libnet_rpc_opaque_auth { - u_int32_t rpc_auth_flavor; - u_int32_t rpc_auth_length; + uint32_t rpc_auth_flavor; + uint32_t rpc_auth_length; #if 0 - u_int8_t *rpc_auth_data; + uint8_t *rpc_auth_data; #endif }; struct libnet_rpc_call { - u_int32_t rpc_rpcvers; /* RPC version - must be 2 */ - u_int32_t rpc_prognum; /* Program Number */ - u_int32_t rpc_vers; /* Program Version */ - u_int32_t rpc_procedure; /* RPC procedure */ + uint32_t rpc_rpcvers; /* RPC version - must be 2 */ + uint32_t rpc_prognum; /* Program Number */ + uint32_t rpc_vers; /* Program Version */ + uint32_t rpc_procedure; /* RPC procedure */ struct libnet_rpc_opaque_auth rpc_credentials; struct libnet_rpc_opaque_auth rpc_verifier; }; struct libnet_rpc_call_hdr { - u_int32_t rpc_xid; /* xid (transaction identifier) */ - u_int32_t rpc_type; + uint32_t rpc_xid; /* xid (transaction identifier) */ + uint32_t rpc_type; struct libnet_rpc_call rpc_call; }; struct libnet_rpc_call_tcp_hdr { - u_int32_t rpc_record_marking; /* used with byte stream protocols */ + uint32_t rpc_record_marking; /* used with byte stream protocols */ struct libnet_rpc_call_hdr rpc_common; }; @@ -1499,18 +1499,18 @@ struct libnet_rpc_call_tcp_hdr */ struct libnet_stp_conf_hdr { - u_int16_t stp_id; /* protocol id */ - u_int8_t stp_version; /* protocol version */ - u_int8_t stp_bpdu_type; /* bridge protocol data unit type */ - u_int8_t stp_flags; /* control flags */ - u_int8_t stp_rootid[8]; /* root id */ - u_int32_t stp_rootpc; /* root path cost */ - u_int8_t stp_bridgeid[8]; /* bridge id */ - u_int16_t stp_portid; /* port id */ - u_int16_t stp_mage; /* message age */ - u_int16_t stp_maxage; /* max age */ - u_int16_t stp_hellot; /* hello time */ - u_int16_t stp_fdelay; /* forward delay */ + uint16_t stp_id; /* protocol id */ + uint8_t stp_version; /* protocol version */ + uint8_t stp_bpdu_type; /* bridge protocol data unit type */ + uint8_t stp_flags; /* control flags */ + uint8_t stp_rootid[8]; /* root id */ + uint32_t stp_rootpc; /* root path cost */ + uint8_t stp_bridgeid[8]; /* bridge id */ + uint16_t stp_portid; /* port id */ + uint16_t stp_mage; /* message age */ + uint16_t stp_maxage; /* max age */ + uint16_t stp_hellot; /* hello time */ + uint16_t stp_fdelay; /* forward delay */ }; @@ -1521,9 +1521,9 @@ struct libnet_stp_conf_hdr */ struct libnet_stp_tcn_hdr { - u_int16_t stp_id; /* protocol id */ - u_int8_t stp_version; /* protocol version */ - u_int8_t stp_bpdu_type; /* bridge protocol data unit type */ + uint16_t stp_id; /* protocol id */ + uint8_t stp_version; /* protocol version */ + uint8_t stp_bpdu_type; /* bridge protocol data unit type */ }; @@ -1534,19 +1534,19 @@ struct libnet_stp_tcn_hdr */ struct libnet_tcp_hdr { - u_int16_t th_sport; /* source port */ - u_int16_t th_dport; /* destination port */ - u_int32_t th_seq; /* sequence number */ - u_int32_t th_ack; /* acknowledgement number */ + uint16_t th_sport; /* source port */ + uint16_t th_dport; /* destination port */ + uint32_t th_seq; /* sequence number */ + uint32_t th_ack; /* acknowledgement number */ #if (LIBNET_LIL_ENDIAN) - u_int8_t th_x2:4, /* (unused) */ + uint8_t th_x2:4, /* (unused) */ th_off:4; /* data offset */ #endif #if (LIBNET_BIG_ENDIAN) - u_int8_t th_off:4, /* data offset */ + uint8_t th_off:4, /* data offset */ th_x2:4; /* (unused) */ #endif - u_int8_t th_flags; /* control flags */ + uint8_t th_flags; /* control flags */ #ifndef TH_FIN #define TH_FIN 0x01 /* finished send data */ #endif @@ -1571,9 +1571,9 @@ struct libnet_tcp_hdr #ifndef TH_CWR #define TH_CWR 0x80 #endif - u_int16_t th_win; /* window */ - u_int16_t th_sum; /* checksum */ - u_int16_t th_urp; /* urgent pointer */ + uint16_t th_win; /* window */ + uint16_t th_sum; /* checksum */ + uint16_t th_urp; /* urgent pointer */ }; /* @@ -1581,17 +1581,17 @@ struct libnet_tcp_hdr */ struct libnet_token_ring_hdr { - u_int8_t token_ring_access_control; + uint8_t token_ring_access_control; #define LIBNET_TOKEN_RING_FRAME 0x10 - u_int8_t token_ring_frame_control; + uint8_t token_ring_frame_control; #define LIBNET_TOKEN_RING_LLC_FRAME 0x40 - u_int8_t token_ring_dhost[TOKEN_RING_ADDR_LEN]; - u_int8_t token_ring_shost[TOKEN_RING_ADDR_LEN]; - u_int8_t token_ring_llc_dsap; - u_int8_t token_ring_llc_ssap; - u_int8_t token_ring_llc_control_field; - u_int8_t token_ring_llc_org_code[LIBNET_ORG_CODE_SIZE]; - u_int16_t token_ring_type; + uint8_t token_ring_dhost[TOKEN_RING_ADDR_LEN]; + uint8_t token_ring_shost[TOKEN_RING_ADDR_LEN]; + uint8_t token_ring_llc_dsap; + uint8_t token_ring_llc_ssap; + uint8_t token_ring_llc_control_field; + uint8_t token_ring_llc_org_code[LIBNET_ORG_CODE_SIZE]; + uint16_t token_ring_type; #define TOKEN_RING_TYPE_IP 0x0800 /* IP protocol */ #define TOKEN_RING_TYPE_ARP 0x0806 /* addr. resolution protocol */ #define TOKEN_RING_TYPE_REVARP 0x8035 /* reverse addr. resolution protocol */ @@ -1599,7 +1599,7 @@ struct libnet_token_ring_hdr struct libnet_token_ring_addr { - u_int8_t token_ring_addr_octet[6]; /* Token Ring address */ + uint8_t token_ring_addr_octet[6]; /* Token Ring address */ }; /* @@ -1609,10 +1609,10 @@ struct libnet_token_ring_addr */ struct libnet_udp_hdr { - u_int16_t uh_sport; /* soure port */ - u_int16_t uh_dport; /* destination port */ - u_int16_t uh_ulen; /* length */ - u_int16_t uh_sum; /* checksum */ + uint16_t uh_sport; /* soure port */ + uint16_t uh_dport; /* destination port */ + uint16_t uh_ulen; /* length */ + uint16_t uh_sum; /* checksum */ }; /* @@ -1621,21 +1621,21 @@ struct libnet_udp_hdr */ struct libnet_sebek_hdr { - u_int32_t magic; /* identify packets that should be hidden */ - u_int16_t version; /* protocol version, currently 1 */ + uint32_t magic; /* identify packets that should be hidden */ + uint16_t version; /* protocol version, currently 1 */ #define SEBEK_PROTO_VERSION 1 - u_int16_t type; /* type of record (read data is type 0, write data is type 1) */ + uint16_t type; /* type of record (read data is type 0, write data is type 1) */ #define SEBEK_TYPE_READ 0 /* Currently, only read is supported */ #define SEBEK_TYPE_WRITE 1 - u_int32_t counter; /* PDU counter used to identify when packet are lost */ - u_int32_t time_sec; /* seconds since EPOCH according to the honeypot */ - u_int32_t time_usec; /* residual microseconds */ - u_int32_t pid; /* PID */ - u_int32_t uid; /* UID */ - u_int32_t fd; /* FD */ + uint32_t counter; /* PDU counter used to identify when packet are lost */ + uint32_t time_sec; /* seconds since EPOCH according to the honeypot */ + uint32_t time_usec; /* residual microseconds */ + uint32_t pid; /* PID */ + uint32_t uid; /* UID */ + uint32_t fd; /* FD */ #define SEBEK_CMD_LENGTH 12 - u_int8_t cmd[SEBEK_CMD_LENGTH]; /* 12 first characters of the command */ - u_int32_t length; /* length in bytes of the PDU's body */ + uint8_t cmd[SEBEK_CMD_LENGTH]; /* 12 first characters of the command */ + uint32_t length; /* length in bytes of the PDU's body */ }; @@ -1650,25 +1650,25 @@ struct libnet_sebek_hdr struct libnet_vrrp_hdr { #if (LIBNET_LIL_ENDIAN) - u_int8_t vrrp_v:4, /* protocol version */ + uint8_t vrrp_v:4, /* protocol version */ vrrp_t:4; /* packet type */ #endif #if (LIBNET_BIG_ENDIAN) - u_int8_t vrrp_t:4, /* packet type */ + uint8_t vrrp_t:4, /* packet type */ vrrp_v:4; /* protocol version */ #endif #define LIBNET_VRRP_VERSION_01 0x1 #define LIBNET_VRRP_VERSION_02 0x2 #define LIBNET_VRRP_TYPE_ADVERT 0x1 - u_int8_t vrrp_vrouter_id; /* virtual router id */ - u_int8_t vrrp_priority; /* priority */ - u_int8_t vrrp_ip_count; /* number of IP addresses */ - u_int8_t vrrp_auth_type; /* authorization type */ + uint8_t vrrp_vrouter_id; /* virtual router id */ + uint8_t vrrp_priority; /* priority */ + uint8_t vrrp_ip_count; /* number of IP addresses */ + uint8_t vrrp_auth_type; /* authorization type */ #define LIBNET_VRRP_AUTH_NONE 0x1 #define LIBNET_VRRP_AUTH_PASSWD 0x2 #define LIBNET_VRRP_AUTH_IPAH 0x3 - u_int8_t vrrp_advert_int; /* advertisement interval */ - u_int16_t vrrp_sum; /* checksum */ + uint8_t vrrp_advert_int; /* advertisement interval */ + uint16_t vrrp_sum; /* checksum */ /* additional addresses */ /* authentication info */ }; @@ -1681,26 +1681,26 @@ struct libnet_vrrp_hdr struct libnet_hsrp_hdr { #define LIBNET_HSRP_VERSION 0x0 - u_int8_t version; /* Version of the HSRP messages */ + uint8_t version; /* Version of the HSRP messages */ #define LIBNET_HSRP_TYPE_HELLO 0x0 #define LIBNET_HSRP_TYPE_COUP 0x1 #define LIBNET_HSRP_TYPE_RESIGN 0x2 - u_int8_t opcode; /* Type of message */ + uint8_t opcode; /* Type of message */ #define LIBNET_HSRP_STATE_INITIAL 0x0 #define LIBNET_HSRP_STATE_LEARN 0x1 #define LIBNET_HSRP_STATE_LISTEN 0x2 #define LIBNET_HSRP_STATE_SPEAK 0x4 #define LIBNET_HSRP_STATE_STANDBY 0x8 #define LIBNET_HSRP_STATE_ACTIVE 0x10 - u_int8_t state; /* Current state of the router */ - u_int8_t hello_time; /* Period in seconds between hello messages */ - u_int8_t hold_time; /* Seconds that the current hello message is valid */ - u_int8_t priority; /* Priority for the election proccess */ - u_int8_t group; /* Standby group */ - u_int8_t reserved; /* Reserved field */ + uint8_t state; /* Current state of the router */ + uint8_t hello_time; /* Period in seconds between hello messages */ + uint8_t hold_time; /* Seconds that the current hello message is valid */ + uint8_t priority; /* Priority for the election proccess */ + uint8_t group; /* Standby group */ + uint8_t reserved; /* Reserved field */ #define HSRP_AUTHDATA_LENGTH 8 - u_int8_t authdata[HSRP_AUTHDATA_LENGTH]; /* Password */ - u_int32_t virtual_ip; /* Virtual IP address */ + uint8_t authdata[HSRP_AUTHDATA_LENGTH]; /* Password */ + uint32_t virtual_ip; /* Virtual IP address */ }; #endif /* __LIBNET_HEADERS_H */ diff --git a/libnet/include/libnet/libnet-macros.h b/libnet/include/libnet/libnet-macros.h index c4695f3..1cabf93 100644 --- a/libnet/include/libnet/libnet-macros.h +++ b/libnet/include/libnet/libnet-macros.h @@ -141,7 +141,7 @@ if ((payload && !payload_s) || (!payload && payload_s)) \ if (payload && payload_s) \ { \ n = libnet_pblock_append(l, p, payload, payload_s); \ - if (n == (u_int32_t) - 1) \ + if (n == (uint32_t) - 1) \ { \ goto bad; \ } \ @@ -154,13 +154,13 @@ if (payload && payload_s) \ /* used interally for OSPF stuff */ #define LIBNET_OSPF_AUTHCPY(x, y) \ - memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y)) + memcpy((uint8_t *)x, (uint8_t *)y, sizeof(y)) #define LIBNET_OSPF_CKSUMBUF(x, y) \ - memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y)) + memcpy((uint8_t *)x, (uint8_t *)y, sizeof(y)) /* used internally for NTP leap indicator, version, and mode */ #define LIBNET_NTP_DO_LI_VN_MODE(li, vn, md) \ - ((u_int8_t)((((li) << 6) & 0xc0) | (((vn) << 3) & 0x38) | ((md) & 0x7))) + ((uint8_t)((((li) << 6) & 0xc0) | (((vn) << 3) & 0x38) | ((md) & 0x7))) /* Not all systems have IFF_LOOPBACK */ #ifdef IFF_LOOPBACK diff --git a/libnet/include/libnet/libnet-structures.h b/libnet/include/libnet/libnet-structures.h index 64df870..1158c51 100644 --- a/libnet/include/libnet/libnet-structures.h +++ b/libnet/include/libnet/libnet-structures.h @@ -40,10 +40,10 @@ typedef struct libnet_port_list_chain libnet_plist_t; struct libnet_port_list_chain { - u_int16_t node; /* node number */ - u_int16_t bport; /* beggining port */ - u_int16_t eport; /* terminating port */ - u_int8_t id; /* global array offset */ + uint16_t node; /* node number */ + uint16_t bport; /* beggining port */ + uint16_t eport; /* terminating port */ + uint8_t id; /* global array offset */ libnet_plist_t *next; /* next node in the list */ }; @@ -76,23 +76,23 @@ typedef int32_t libnet_ptag_t; */ struct libnet_protocol_block { - u_int8_t *buf; /* protocol buffer */ - u_int32_t b_len; /* length of buf */ - u_int16_t h_len; /* header length (for checksumming) */ + uint8_t *buf; /* protocol buffer */ + uint32_t b_len; /* length of buf */ + uint16_t h_len; /* header length (for checksumming) */ /* Unused for IPV4_H block types. * For protocols that sit on top of IP, it should be the the amount of * buf that is the header, and will be included in the checksum. */ - u_int32_t ip_offset; /* offset from end of pkt to beginning of IP header for csums */ + uint32_t ip_offset; /* offset from end of pkt to beginning of IP header for csums */ /* Unused for IPV4_H block types. * For protocols that sit on top of IP (UDP, ICMP, ...), they often * include some information from the IP header (in the form of a "pseudo * header") in their own checksum calculation. To build that * pseudo-header, thet need to find the real header. */ - u_int32_t copied; /* bytes copied - the amount of data copied into buf */ + uint32_t copied; /* bytes copied - the amount of data copied into buf */ /* Used and updated by libnet_pblock_append(). */ - u_int8_t type; /* type of pblock */ + uint8_t type; /* type of pblock */ /* this needs to be updated every time a new packet builder is added */ #define LIBNET_PBLOCK_ARP_H 0x01 /* ARP header */ #define LIBNET_PBLOCK_DHCPV4_H 0x02 /* DHCP v4 header */ @@ -158,7 +158,7 @@ struct libnet_protocol_block #define LIBNET_PBLOCK_IPV6_HBHOPTS_H 0x3e /* IPv6 hop/hop opts header */ #define LIBNET_PBLOCK_SEBEK_H 0x3f /* Sebek header */ #define LIBNET_PBLOCK_HSRP_H 0x40 /* HSRP header */ - u_int8_t flags; /* control flags */ + uint8_t flags; /* control flags */ #define LIBNET_PBLOCK_DO_CHECKSUM 0x01 /* needs a checksum */ libnet_ptag_t ptag; /* protocol block tag */ struct libnet_protocol_block *next; /* next pblock */ @@ -192,7 +192,7 @@ struct libnet_context libnet_pblock_t *protocol_blocks; /* protocol headers / data */ libnet_pblock_t *pblock_end; /* last node in list */ - u_int32_t n_pblocks; /* number of pblocks */ + uint32_t n_pblocks; /* number of pblocks */ int link_type; /* link-layer type */ int link_offset; /* link-layer header size */ @@ -204,7 +204,7 @@ struct libnet_context char label[LIBNET_LABEL_SIZE]; /* textual label for cq interface */ char err_buf[LIBNET_ERRBUF_SIZE]; /* error buffer */ - u_int32_t total_size; /* total size */ + uint32_t total_size; /* total size */ }; typedef struct libnet_context libnet_t; @@ -223,8 +223,8 @@ struct _libnet_context_queue struct _libnet_context_queue_descriptor { - u_int32_t node; /* number of nodes in the list */ - u_int32_t cq_lock; /* lock status */ + uint32_t node; /* number of nodes in the list */ + uint32_t cq_lock; /* lock status */ libnet_cq_t *current; /* current context */ }; typedef struct _libnet_context_queue_descriptor libnet_cqd_t; -- cgit v1.2.1