head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.78 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.76 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.74 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.72 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.70 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.68 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.66 pkgsrc-2024Q3-base:1.2 pkgsrc-2024Q2:1.2.0.64 pkgsrc-2024Q2-base:1.2 pkgsrc-2024Q1:1.2.0.62 pkgsrc-2024Q1-base:1.2 pkgsrc-2023Q4:1.2.0.60 pkgsrc-2023Q4-base:1.2 pkgsrc-2023Q3:1.2.0.58 pkgsrc-2023Q3-base:1.2 pkgsrc-2023Q2:1.2.0.56 pkgsrc-2023Q2-base:1.2 pkgsrc-2023Q1:1.2.0.54 pkgsrc-2023Q1-base:1.2 pkgsrc-2022Q4:1.2.0.52 pkgsrc-2022Q4-base:1.2 pkgsrc-2022Q3:1.2.0.50 pkgsrc-2022Q3-base:1.2 pkgsrc-2022Q2:1.2.0.48 pkgsrc-2022Q2-base:1.2 pkgsrc-2022Q1:1.2.0.46 pkgsrc-2022Q1-base:1.2 pkgsrc-2021Q4:1.2.0.44 pkgsrc-2021Q4-base:1.2 pkgsrc-2021Q3:1.2.0.42 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.2.0.40 pkgsrc-2021Q2-base:1.2 pkgsrc-2021Q1:1.2.0.38 pkgsrc-2021Q1-base:1.2 pkgsrc-2020Q4:1.2.0.36 pkgsrc-2020Q4-base:1.2 pkgsrc-2020Q3:1.2.0.34 pkgsrc-2020Q3-base:1.2 pkgsrc-2020Q2:1.2.0.30 pkgsrc-2020Q2-base:1.2 pkgsrc-2020Q1:1.2.0.10 pkgsrc-2020Q1-base:1.2 pkgsrc-2019Q4:1.2.0.32 pkgsrc-2019Q4-base:1.2 pkgsrc-2019Q3:1.2.0.28 pkgsrc-2019Q3-base:1.2 pkgsrc-2019Q2:1.2.0.26 pkgsrc-2019Q2-base:1.2 pkgsrc-2019Q1:1.2.0.24 pkgsrc-2019Q1-base:1.2 pkgsrc-2018Q4:1.2.0.22 pkgsrc-2018Q4-base:1.2 pkgsrc-2018Q3:1.2.0.20 pkgsrc-2018Q3-base:1.2 pkgsrc-2018Q2:1.2.0.18 pkgsrc-2018Q2-base:1.2 pkgsrc-2018Q1:1.2.0.16 pkgsrc-2018Q1-base:1.2 pkgsrc-2017Q4:1.2.0.14 pkgsrc-2017Q4-base:1.2 pkgsrc-2017Q3:1.2.0.12 pkgsrc-2017Q3-base:1.2 pkgsrc-2017Q2:1.2.0.8 pkgsrc-2017Q2-base:1.2 pkgsrc-2017Q1:1.2.0.6 pkgsrc-2017Q1-base:1.2 pkgsrc-2016Q4:1.2.0.4 pkgsrc-2016Q4-base:1.2 pkgsrc-2016Q3:1.2.0.2 pkgsrc-2016Q3-base:1.2 pkgsrc-2016Q2:1.1.0.56 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.54 pkgsrc-2016Q1-base:1.1 pkgsrc-2015Q4:1.1.0.52 pkgsrc-2015Q4-base:1.1 pkgsrc-2015Q3:1.1.0.50 pkgsrc-2015Q3-base:1.1 pkgsrc-2015Q2:1.1.0.48 pkgsrc-2015Q2-base:1.1 pkgsrc-2015Q1:1.1.0.46 pkgsrc-2015Q1-base:1.1 pkgsrc-2014Q4:1.1.0.44 pkgsrc-2014Q4-base:1.1 pkgsrc-2014Q3:1.1.0.42 pkgsrc-2014Q3-base:1.1 pkgsrc-2014Q2:1.1.0.40 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.38 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.36 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.34 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.32 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.30 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.28 pkgsrc-2012Q4-base:1.1 pkgsrc-2012Q3:1.1.0.26 pkgsrc-2012Q3-base:1.1 pkgsrc-2012Q2:1.1.0.24 pkgsrc-2012Q2-base:1.1 pkgsrc-2012Q1:1.1.0.22 pkgsrc-2012Q1-base:1.1 pkgsrc-2011Q4:1.1.0.20 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q3:1.1.0.18 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.16 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.14 pkgsrc-2011Q1-base:1.1 pkgsrc-2010Q4:1.1.0.12 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.10 pkgsrc-2010Q3-base:1.1 pkgsrc-2010Q2:1.1.0.8 pkgsrc-2010Q2-base:1.1 pkgsrc-2010Q1:1.1.0.6 pkgsrc-2010Q1-base:1.1 pkgsrc-2009Q4:1.1.0.4 pkgsrc-2009Q4-base:1.1 pkgsrc-2009Q3:1.1.0.2 pkgsrc-2009Q3-base:1.1; locks; strict; comment @# @; 1.2 date 2016.08.30.13.57.31; author he; state Exp; branches; next 1.1; commitid 0MM6elo8hCLNNkkz; 1.1 date 2009.07.26.20.14.44; author schmonz; state Exp; branches; next ; desc @@ 1.2 log @Use explitly sized types when defining structs which represent on-the-wire data, so that this works on LP64 platforms. In particular u_long -> uint32_t, but u_short also got the corresponding treatment. Fixes PR#51450. @ text @$NetBSD: patch-ae,v 1.1 2009/07/26 20:14:44 schmonz Exp $ Treat Apple as Linux. Use explicitly sized types to fix this on LP64 platforms. --- include/libnet/libnet-headers.h.orig 2000-12-13 15:38:40.000000000 -0500 +++ include/libnet/libnet-headers.h @@@@ -87,9 +87,9 @@@@ struct libnet_ip_hdr ip_hl:4; /* header length */ #endif u_char ip_tos; /* type of service */ - u_short ip_len; /* total length */ - u_short ip_id; /* identification */ - u_short 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 @@@@ -104,7 +104,7 @@@@ struct libnet_ip_hdr #endif u_char ip_ttl; /* time to live */ u_char ip_p; /* protocol */ - u_short ip_sum; /* checksum */ + uint16_t ip_sum; /* checksum */ struct in_addr ip_src, ip_dst; /* source and dest address */ }; @@@@ -113,10 +113,10 @@@@ struct libnet_ip_hdr */ struct libnet_tcp_hdr { - u_short th_sport; /* source port */ - u_short th_dport; /* destination port */ - u_long th_seq; /* sequence number */ - u_long 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_char th_x2:4, /* (unused) */ th_off:4; /* data offset */ @@@@ -144,9 +144,9 @@@@ struct libnet_tcp_hdr #ifndef TH_URG #define TH_URG 0x20 #endif - u_short th_win; /* window */ - u_short th_sum; /* checksum */ - u_short th_urp; /* urgent pointer */ + uint16_t th_win; /* window */ + uint16_t th_sum; /* checksum */ + uint16_t th_urp; /* urgent pointer */ }; @@@@ -155,10 +155,10 @@@@ struct libnet_tcp_hdr */ struct libnet_udp_hdr { - u_short uh_sport; /* soure port */ - u_short uh_dport; /* destination port */ - u_short uh_ulen; /* length */ - u_short 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 */ }; @@@@ -290,14 +290,14 @@@@ struct libnet_icmp_hdr #define ICMP_PARAMPROB_OPTABSENT 1 #endif - u_short icmp_sum; + uint16_t icmp_sum; union { struct { - u_short id; - u_short seq; + uint16_t id; + uint16_t seq; }echo; #undef icmp_id @@@@ -305,11 +305,11 @@@@ struct libnet_icmp_hdr #define icmp_id hun.echo.id #define icmp_seq hun.echo.seq - u_long gateway; + uint32_t gateway; struct { - u_short pad; - u_short mtu; + uint16_t pad; + uint16_t mtu; }frag; }hun; union @@@@ -325,7 +325,7 @@@@ struct libnet_icmp_hdr struct ip idi_ip; /* options and then 64 bits of data */ }ip; - u_long mask; + uint32_t mask; char data[1]; #undef icmp_mask @@@@ -362,7 +362,7 @@@@ struct libnet_igmp_hdr #define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */ #endif u_char igmp_code; - u_short igmp_sum; + uint16_t igmp_sum; struct in_addr igmp_group; }; @@@@ -378,7 +378,7 @@@@ struct libnet_ethernet_hdr #endif u_char ether_dhost[ETHER_ADDR_LEN]; /* destination ethernet address */ u_char ether_shost[ETHER_ADDR_LEN]; /* source ethernet address */ - u_short ether_type; /* packet type ID */ + uint16_t ether_type; /* packet type ID */ }; #define ETHERTYPE_PUP 0x0200 /* PUP protocol */ @@@@ -401,12 +401,12 @@@@ struct ether_addr */ struct libnet_arp_hdr { - u_short ar_hrd; /* format of hardware address */ + uint16_t ar_hrd; /* format of hardware address */ #define ARPHRD_ETHER 1 /* ethernet hardware format */ - u_short ar_pro; /* format of protocol address */ + uint16_t ar_pro; /* format of protocol address */ u_char ar_hln; /* length of hardware address */ u_char ar_pln; /* length of protocol addres */ - u_short ar_op; /* operation type */ + 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 */ @@@@ -429,12 +429,12 @@@@ struct libnet_arp_hdr */ struct libnet_dns_hdr { - u_short id; /* DNS packet ID */ - u_short flags; /* DNS flags */ - u_short num_q; /* Number of questions */ - u_short num_answ_rr; /* Number of answer resource records */ - u_short num_auth_rr; /* Number of authority resource records */ - u_short 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 */ }; @@@@ -455,13 +455,13 @@@@ struct libnet_rip_hdr #define RIPVER_0 0 #define RIPVER_1 1 #define RIPVER_2 2 - u_short rd; /* Zero (v1) or Routing Domain (v2) */ - u_short af; /* Address family */ - u_short rt; /* Zero (v1) or Route Tag (v2) */ - u_long addr; /* IP address */ - u_long mask; /* Zero (v1) or Subnet Mask (v2) */ - u_long next_hop; /* Zero (v1) or Next hop IP address (v2) */ - u_long metric; /* Metric */ + uint16_t rd; /* Zero (v1) or Routing Domain (v2) */ + uint16_t af; /* Address family */ + uint16_t rt; /* Zero (v1) or Route Tag (v2) */ + uint32_t addr; /* IP address */ + uint32_t mask; /* Zero (v1) or Subnet Mask (v2) */ + uint32_t next_hop; /* Zero (v1) or Next hop IP address (v2) */ + uint32_t metric; /* Metric */ }; /* @@@@ -489,7 +489,7 @@@@ struct libnet_vrrp_hdr #define LIBNET_VRRP_AUTH_PASSWD 0x2 #define LIBNET_VRRP_AUTH_IPAH 0x3 u_char vrrp_advert_int; /* advertisement interval */ - u_short vrrp_sum; /* checksum */ + uint16_t vrrp_sum; /* checksum */ }; #if 0 @@@@ -509,7 +509,7 @@@@ struct tcpoption }; -#if (__linux__) +#if (__linux__) || defined(__APPLE__) /* * Linux has a radically different IP options structure from BSD. */ @ 1.1 log @Fix build on OS X (patch from MacPorts). @ text @d1 4 a4 1 $NetBSD$ d8 190 @