@@ -217,6 +217,196 @@ s! {
217217 pub struct in6_addr {
218218 pub s6_addr: [ u8 ; 16 ] ,
219219 }
220+
221+ pub struct ip6_hbh {
222+ pub ip6h_nxt: u8 ,
223+ pub ip6h_len: u8 ,
224+ }
225+
226+ pub struct ip6_dest {
227+ pub ip6d_nxt: u8 ,
228+ pub ip6d_len: u8 ,
229+ }
230+
231+ pub struct ip6_rthdr {
232+ pub ip6r_nxt: u8 ,
233+ pub ip6r_len: u8 ,
234+ pub ip6r_type: u8 ,
235+ pub ip6r_segleft: u8 ,
236+ }
237+
238+ #[ cfg_attr( any(
239+ target_os = "freebsd" ,
240+ target_os = "openbsd" ,
241+ target_os = "netbsd" ,
242+ target_os = "dragonfly" ,
243+ target_os = "macos"
244+ ) , repr( packed) ) ]
245+ pub struct ip6_rthdr0 {
246+ pub ip6r0_nxt: u8 ,
247+ pub ip6r0_len: u8 ,
248+ pub ip6r0_type: u8 ,
249+ pub ip6r0_segleft: u8 ,
250+ #[ cfg( not( target_os = "linux" ) ) ]
251+ pub ip6r0_reserved: u32 ,
252+ #[ cfg( target_os = "linux" ) ]
253+ pub ip6r0_reserved: u8 ,
254+ #[ cfg( target_os = "linux" ) ]
255+ pub ip6r0_slmap: [ u8 ; 3 ] ,
256+ #[ cfg( target_os = "linux" ) ]
257+ pub ip6r0_addr: [ in6_addr; 0 ] ,
258+ }
259+
260+ #[ cfg_attr( any(
261+ target_os = "freebsd" ,
262+ target_os = "openbsd" ,
263+ target_os = "netbsd" ,
264+ target_os = "dragonfly" ,
265+ target_os = "macos"
266+ ) , repr( packed) ) ]
267+ pub struct ip6_frag {
268+ ip6f_nxt: u8 ,
269+ ip6f_reserved: u8 ,
270+ ip6f_offlg: u16 ,
271+ ip6f_ident: u32 ,
272+ }
273+
274+ pub struct icmp6_filter {
275+ pub icmp6_filt: [ u32 ; 8 ] ,
276+ }
277+
278+ #[ cfg_attr( any(
279+ target_os = "freebsd" ,
280+ target_os = "openbsd" ,
281+ target_os = "netbsd" ,
282+ target_os = "dragonfly" ,
283+ target_os = "macos"
284+ ) , repr( packed) ) ]
285+ pub struct icmp6_hdr {
286+ pub icmp6_type: u8 ,
287+ pub icmp6_code: u8 ,
288+ pub icmp6_cksum: u16 ,
289+ pub icmp6_data8: [ u8 ; 4 ] ,
290+ }
291+
292+ #[ cfg_attr( any(
293+ target_os = "freebsd" ,
294+ target_os = "openbsd" ,
295+ target_os = "netbsd" ,
296+ target_os = "dragonfly" ,
297+ target_os = "macos"
298+ ) , repr( packed) ) ]
299+ pub struct nd_router_solicit {
300+ pub nd_rs_hdr: icmp6_hdr,
301+ }
302+
303+ #[ cfg_attr( any(
304+ target_os = "freebsd" ,
305+ target_os = "openbsd" ,
306+ target_os = "netbsd" ,
307+ target_os = "dragonfly" ,
308+ target_os = "macos"
309+ ) , repr( packed) ) ]
310+ pub struct nd_router_advert {
311+ pub nd_ra_hdr: icmp6_hdr,
312+ pub nd_ra_reachable: u32 ,
313+ pub nd_ra_retransmit: u32 ,
314+ }
315+
316+ #[ cfg_attr( any(
317+ target_os = "freebsd" ,
318+ target_os = "openbsd" ,
319+ target_os = "netbsd" ,
320+ target_os = "dragonfly" ,
321+ target_os = "macos"
322+ ) , repr( packed) ) ]
323+ pub struct nd_neighbor_solicit {
324+ pub nd_ns_hdr: icmp6_hdr,
325+ pub nd_ns_target: in6_addr,
326+ }
327+
328+ #[ cfg_attr( any(
329+ target_os = "freebsd" ,
330+ target_os = "openbsd" ,
331+ target_os = "netbsd" ,
332+ target_os = "dragonfly" ,
333+ target_os = "macos"
334+ ) , repr( packed) ) ]
335+ pub struct nd_neighbor_advert {
336+ pub nd_na_hdr: icmp6_hdr,
337+ pub nd_na_target: in6_addr,
338+ }
339+
340+ #[ cfg_attr( any(
341+ target_os = "freebsd" ,
342+ target_os = "openbsd" ,
343+ target_os = "netbsd" ,
344+ target_os = "dragonfly" ,
345+ target_os = "macos"
346+ ) , repr( packed) ) ]
347+ pub struct nd_redirect {
348+ pub nd_rd_hdr: icmp6_hdr,
349+ pub nd_rd_target: in6_addr,
350+ pub nd_rd_dst: in6_addr,
351+ }
352+
353+ #[ cfg_attr( any(
354+ target_os = "freebsd" ,
355+ target_os = "openbsd" ,
356+ target_os = "netbsd" ,
357+ target_os = "dragonfly" ,
358+ target_os = "macos"
359+ ) , repr( packed) ) ]
360+ pub struct nd_opt_hdr {
361+ pub nd_opt_type: u8 ,
362+ pub nd_opt_len: u8 ,
363+ }
364+
365+ #[ cfg_attr( any(
366+ target_os = "freebsd" ,
367+ target_os = "openbsd" ,
368+ target_os = "netbsd" ,
369+ target_os = "dragonfly" ,
370+ target_os = "macos"
371+ ) , repr( packed) ) ]
372+ pub struct nd_opt_prefix_info {
373+ pub nd_opt_pi_type: u8 ,
374+ pub nd_opt_pi_len: u8 ,
375+ pub nd_opt_pi_prefix_len: u8 ,
376+ pub nd_opt_pi_flags_reserved: u8 ,
377+ pub nd_opt_pi_valid_time: u32 ,
378+ pub nd_opt_pi_preferred_time: u32 ,
379+ pub nd_opt_pi_reserved2: u32 ,
380+ pub nd_opt_pi_prefix: in6_addr,
381+ }
382+
383+ #[ cfg_attr( any(
384+ target_os = "freebsd" ,
385+ target_os = "openbsd" ,
386+ target_os = "netbsd" ,
387+ target_os = "dragonfly" ,
388+ target_os = "macos"
389+ ) , repr( packed) ) ]
390+ pub struct nd_opt_rd_hdr {
391+ pub nd_opt_rh_type: u8 ,
392+ pub nd_opt_rh_len: u8 ,
393+ pub nd_opt_rh_reserved1: u16 ,
394+ pub nd_opt_rh_reserved2: u32 ,
395+ }
396+
397+ #[ cfg_attr( any(
398+ target_os = "freebsd" ,
399+ target_os = "openbsd" ,
400+ target_os = "netbsd" ,
401+ target_os = "dragonfly" ,
402+ target_os = "macos"
403+ ) , repr( packed) ) ]
404+ pub struct nd_opt_mtu {
405+ pub nd_opt_mtu_type: u8 ,
406+ pub nd_opt_mtu_len: u8 ,
407+ pub nd_opt_mtu_reserved: u16 ,
408+ pub nd_opt_mtu_mtu: u32 ,
409+ }
220410}
221411
222412s_no_extra_traits ! {
@@ -364,6 +554,63 @@ pub const ATF_PERM: c_int = 0x04;
364554pub const ATF_PUBL : c_int = 0x08 ;
365555pub const ATF_USETRAILERS : c_int = 0x10 ;
366556
557+ // ICMPv6 Type and Code Values
558+ pub const ICMP6_DST_UNREACH : u8 = 1 ;
559+ pub const ICMP6_PACKET_TOO_BIG : u8 = 2 ;
560+ pub const ICMP6_TIME_EXCEEDED : u8 = 3 ;
561+ pub const ICMP6_PARAM_PROB : u8 = 4 ;
562+
563+ pub const ICMP6_INFOMSG_MASK : u8 = 0x80 ;
564+
565+ pub const ICMP6_ECHO_REQUEST : u8 = 128 ;
566+ pub const ICMP6_ECHO_REPLY : u8 = 129 ;
567+ pub const MLD_LISTENER_QUERY : u8 = 130 ;
568+ pub const MLD_LISTENER_REPORT : u8 = 131 ;
569+ pub const MLD_LISTENER_REDUCTION : u8 = 132 ;
570+
571+ pub const ICMP6_DST_UNREACH_NOROUTE : u8 = 0 ;
572+ pub const ICMP6_DST_UNREACH_ADMIN : u8 = 1 ;
573+ pub const ICMP6_DST_UNREACH_BEYONDSCOPE : u8 = 2 ;
574+ pub const ICMP6_DST_UNREACH_ADDR : u8 = 3 ;
575+ pub const ICMP6_DST_UNREACH_NOPORT : u8 = 4 ;
576+
577+ pub const ICMP6_TIME_EXCEED_TRANSIT : u8 = 0 ;
578+ pub const ICMP6_TIME_EXCEED_REASSEMBLY : u8 = 1 ;
579+
580+ pub const ICMP6_PARAMPROB_HEADER : u8 = 0 ;
581+ pub const ICMP6_PARAMPROB_NEXTHEADER : u8 = 1 ;
582+ pub const ICMP6_PARAMPROB_OPTION : u8 = 2 ;
583+
584+ // ICMPv6 Neighbor Discovery Type and Code Values
585+ pub const ND_ROUTER_SOLICIT : u8 = 133 ;
586+ pub const ND_ROUTER_ADVERT : u8 = 134 ;
587+ pub const ND_NEIGHBOR_SOLICIT : u8 = 135 ;
588+ pub const ND_NEIGHBOR_ADVERT : u8 = 136 ;
589+ pub const ND_REDIRECT : u8 = 137 ;
590+
591+ pub const ND_RA_FLAG_MANAGED : u8 = 0x80 ;
592+ pub const ND_RA_FLAG_OTHER : u8 = 0x40 ;
593+
594+ cfg_if ! {
595+ if #[ cfg( target_endian = "big" ) ] {
596+ pub const ND_NA_FLAG_ROUTER : u32 = 0x80000000 ;
597+ pub const ND_NA_FLAG_SOLICITED : u32 = 0x40000000 ;
598+ pub const ND_NA_FLAG_OVERRIDE : u32 = 0x20000000 ;
599+ } else {
600+ pub const ND_NA_FLAG_ROUTER : u32 = 0x00000080 ;
601+ pub const ND_NA_FLAG_SOLICITED : u32 = 0x00000040 ;
602+ pub const ND_NA_FLAG_OVERRIDE : u32 = 0x00000020 ;
603+ }
604+ }
605+
606+ pub const ND_OPT_SOURCE_LINKADDR : u8 = 1 ;
607+ pub const ND_OPT_TARGET_LINKADDR : u8 = 2 ;
608+ pub const ND_OPT_PREFIX_INFORMATION : u8 = 3 ;
609+ pub const ND_OPT_REDIRECTED_HEADER : u8 = 4 ;
610+ pub const ND_OPT_MTU : u8 = 5 ;
611+ pub const ND_OPT_PI_FLAG_ONLINK : u8 = 0x80 ;
612+ pub const ND_OPT_PI_FLAG_AUTO : u8 = 0x40 ;
613+
367614cfg_if ! {
368615 if #[ cfg( any( target_os = "nto" , target_os = "aix" ) ) ] {
369616 pub const FNM_PERIOD : c_int = 1 << 1 ;
0 commit comments