• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #define SCOPE6_ID_MAX 16
6 
7 struct in6_addrlifetime {
8   time_t ia6t_expire;    /* valid lifetime expiration time */
9   time_t ia6t_preferred; /* preferred lifetime expiration time */
10   u_int32_t ia6t_vltime; /* valid lifetime */
11   u_int32_t ia6t_pltime; /* prefix lifetime */
12 };
13 
14 struct in6_ifstat {
15   u_quad_t ifs6_in_receive;      /* # of total input datagram */
16   u_quad_t ifs6_in_hdrerr;       /* # of datagrams with invalid hdr */
17   u_quad_t ifs6_in_toobig;       /* # of datagrams exceeded MTU */
18   u_quad_t ifs6_in_noroute;      /* # of datagrams with no route */
19   u_quad_t ifs6_in_addrerr;      /* # of datagrams with invalid dst */
20   u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */
21                                  /* NOTE: increment on final dst if */
22   u_quad_t ifs6_in_truncated;    /* # of truncated datagrams */
23   u_quad_t ifs6_in_discard;      /* # of discarded datagrams */
24                                  /* NOTE: fragment timeout is not here */
25   u_quad_t ifs6_in_deliver;      /* # of datagrams delivered to ULP */
26                                  /* NOTE: increment on final dst if */
27   u_quad_t ifs6_out_forward;     /* # of datagrams forwarded */
28                                  /* NOTE: increment on outgoing if */
29   u_quad_t ifs6_out_request;     /* # of outgoing datagrams from ULP */
30                                  /* NOTE: does not include forwrads */
31   u_quad_t ifs6_out_discard;     /* # of discarded datagrams */
32   u_quad_t ifs6_out_fragok;      /* # of datagrams fragmented */
33   u_quad_t ifs6_out_fragfail;    /* # of datagrams failed on fragment */
34   u_quad_t ifs6_out_fragcreat;   /* # of fragment datagrams */
35                                  /* NOTE: this is # after fragment */
36   u_quad_t ifs6_reass_reqd;      /* # of incoming fragmented packets */
37                                  /* NOTE: increment on final dst if */
38   u_quad_t ifs6_reass_ok;        /* # of reassembled packets */
39                                  /* NOTE: this is # after reass */
40                                  /* NOTE: increment on final dst if */
41   u_quad_t ifs6_reass_fail;      /* # of reass failures */
42                                  /* NOTE: may not be packet count */
43                                  /* NOTE: increment on final dst if */
44   u_quad_t ifs6_in_mcast;        /* # of inbound multicast datagrams */
45   u_quad_t ifs6_out_mcast;       /* # of outbound multicast datagrams */
46 };
47 
48 struct icmp6_ifstat {
49   /*
50    * Input statistics
51    */
52   /* ipv6IfIcmpInMsgs, total # of input messages */
53   u_quad_t ifs6_in_msg;
54   /* ipv6IfIcmpInErrors, # of input error messages */
55   u_quad_t ifs6_in_error;
56   /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */
57   u_quad_t ifs6_in_dstunreach;
58   /* ipv6IfIcmpInAdminProhibs, # of input admin. prohibited errs */
59   u_quad_t ifs6_in_adminprohib;
60   /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */
61   u_quad_t ifs6_in_timeexceed;
62   /* ipv6IfIcmpInParamProblems, # of input parameter problem errors */
63   u_quad_t ifs6_in_paramprob;
64   /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */
65   u_quad_t ifs6_in_pkttoobig;
66   /* ipv6IfIcmpInEchos, # of input echo requests */
67   u_quad_t ifs6_in_echo;
68   /* ipv6IfIcmpInEchoReplies, # of input echo replies */
69   u_quad_t ifs6_in_echoreply;
70   /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */
71   u_quad_t ifs6_in_routersolicit;
72   /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */
73   u_quad_t ifs6_in_routeradvert;
74   /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */
75   u_quad_t ifs6_in_neighborsolicit;
76   /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advs. */
77   u_quad_t ifs6_in_neighboradvert;
78   /* ipv6IfIcmpInRedirects, # of input redirects */
79   u_quad_t ifs6_in_redirect;
80   /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */
81   u_quad_t ifs6_in_mldquery;
82   /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */
83   u_quad_t ifs6_in_mldreport;
84   /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */
85   u_quad_t ifs6_in_mlddone;
86   /*
87    * Output statistics. We should solve unresolved routing problem...
88    */
89   /* ipv6IfIcmpOutMsgs, total # of output messages */
90   u_quad_t ifs6_out_msg;
91   /* ipv6IfIcmpOutErrors, # of output error messages */
92   u_quad_t ifs6_out_error;
93   /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */
94   u_quad_t ifs6_out_dstunreach;
95   /* ipv6IfIcmpOutAdminProhibs, # of output admin. prohibited errs */
96   u_quad_t ifs6_out_adminprohib;
97   /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */
98   u_quad_t ifs6_out_timeexceed;
99   /* ipv6IfIcmpOutParamProblems, # of output parameter problem errors */
100   u_quad_t ifs6_out_paramprob;
101   /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */
102   u_quad_t ifs6_out_pkttoobig;
103   /* ipv6IfIcmpOutEchos, # of output echo requests */
104   u_quad_t ifs6_out_echo;
105   /* ipv6IfIcmpOutEchoReplies, # of output echo replies */
106   u_quad_t ifs6_out_echoreply;
107   /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */
108   u_quad_t ifs6_out_routersolicit;
109   /* ipv6IfIcmpOutRouterAdvertisements, # of output router advs. */
110   u_quad_t ifs6_out_routeradvert;
111   /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */
112   u_quad_t ifs6_out_neighborsolicit;
113   /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advs. */
114   u_quad_t ifs6_out_neighboradvert;
115   /* ipv6IfIcmpOutRedirects, # of output redirects */
116   u_quad_t ifs6_out_redirect;
117   /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */
118   u_quad_t ifs6_out_mldquery;
119   /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */
120   u_quad_t ifs6_out_mldreport;
121   /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */
122   u_quad_t ifs6_out_mlddone;
123 };
124 
125 struct in6_ifreq {
126   char ifr_name[IFNAMSIZ];
127   union {
128     struct sockaddr_in6 ifru_addr;
129     struct sockaddr_in6 ifru_dstaddr;
130     int ifru_flags;
131     int ifru_flags6;
132     int ifru_metric;
133     int ifru_intval;
134     caddr_t ifru_data;
135     struct in6_addrlifetime ifru_lifetime;
136     struct in6_ifstat ifru_stat;
137     struct icmp6_ifstat ifru_icmp6stat;
138     u_int32_t ifru_scope_id[SCOPE6_ID_MAX];
139   } ifr_ifru;
140 };
141 
142 #define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq)
143 
144 #define IN6_IFF_DEPRECATED 0x0010 /* deprecated address */
145