Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qnetworkinterface_uikit_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNETWORKINTERFACE_UIKIT_P_H
5#define QNETWORKINTERFACE_UIKIT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18// Platform SDK for iOS, tvOS and watchOS is missing those headers:
19// net/if_media.h, netinet/in_var.h, netinet6/in6_var.h This header is
20// a workaround, it provides missing macros and structs.
21
22// <net/if_media.h>:
23
24/*
25 * Ethernet
26 */
27#define IFM_ETHER 0x00000020
28/*
29 * FDDI
30 */
31#define IFM_FDDI 0x00000060
32/*
33 * IEEE 802.11 Wireless
34 */
35#define IFM_IEEE80211 0x00000080
36/*
37 * Masks
38 */
39#define IFM_NMASK 0x000000e0 /* Network type */
40/*
41 * Macros to extract various bits of information from the media word.
42 */
43#define IFM_TYPE(x) ((x) & IFM_NMASK)
44
45// <netinet6/in6_var.h>:
46
48 time_t ia6t_expire; /* valid lifetime expiration time */
49 time_t ia6t_preferred; /* preferred lifetime expiration time */
50 u_int32_t ia6t_vltime; /* valid lifetime */
51 u_int32_t ia6t_pltime; /* prefix lifetime */
52};
53
54/*
55 * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12).
56 */
57struct in6_ifstat {
58 u_quad_t ifs6_in_receive; /* # of total input datagram */
59 u_quad_t ifs6_in_hdrerr; /* # of datagrams with invalid hdr */
60 u_quad_t ifs6_in_toobig; /* # of datagrams exceeded MTU */
61 u_quad_t ifs6_in_noroute; /* # of datagrams with no route */
62 u_quad_t ifs6_in_addrerr; /* # of datagrams with invalid dst */
63 u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */
64 /* NOTE: increment on final dst if */
65 u_quad_t ifs6_in_truncated; /* # of truncated datagrams */
66 u_quad_t ifs6_in_discard; /* # of discarded datagrams */
67 /* NOTE: fragment timeout is not here */
68 u_quad_t ifs6_in_deliver; /* # of datagrams delivered to ULP */
69 /* NOTE: increment on final dst if */
70 u_quad_t ifs6_out_forward; /* # of datagrams forwarded */
71 /* NOTE: increment on outgoing if */
72 u_quad_t ifs6_out_request; /* # of outgoing datagrams from ULP */
73 /* NOTE: does not include forwrads */
74 u_quad_t ifs6_out_discard; /* # of discarded datagrams */
75 u_quad_t ifs6_out_fragok; /* # of datagrams fragmented */
76 u_quad_t ifs6_out_fragfail; /* # of datagrams failed on fragment */
77 u_quad_t ifs6_out_fragcreat; /* # of fragment datagrams */
78 /* NOTE: this is # after fragment */
79 u_quad_t ifs6_reass_reqd; /* # of incoming fragmented packets */
80 /* NOTE: increment on final dst if */
81 u_quad_t ifs6_reass_ok; /* # of reassembled packets */
82 /* NOTE: this is # after reass */
83 /* NOTE: increment on final dst if */
84 u_quad_t ifs6_atmfrag_rcvd; /* # of atomic fragments received */
85 u_quad_t ifs6_reass_fail; /* # of reass failures */
86 /* NOTE: may not be packet count */
87 /* NOTE: increment on final dst if */
88 u_quad_t ifs6_in_mcast; /* # of inbound multicast datagrams */
89 u_quad_t ifs6_out_mcast; /* # of outbound multicast datagrams */
90
91 u_quad_t ifs6_cantfoward_icmp6; /* # of ICMPv6 packets received for unreachable dest */
92 u_quad_t ifs6_addr_expiry_cnt; /* # of address expiry events (excluding privacy addresses) */
93 u_quad_t ifs6_pfx_expiry_cnt; /* # of prefix expiry events */
94 u_quad_t ifs6_defrtr_expiry_cnt; /* # of default router expiry events */
95};
96
97/*
98 * ICMPv6 interface statistics, as defined in RFC2466 Ipv6IfIcmpEntry.
99 * XXX: I'm not sure if this file is the right place for this structure...
100 */
102 /*
103 * Input statistics
104 */
105 /* ipv6IfIcmpInMsgs, total # of input messages */
106 u_quad_t ifs6_in_msg;
107 /* ipv6IfIcmpInErrors, # of input error messages */
109 /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */
111 /* ipv6IfIcmpInAdminProhibs, # of input admin. prohibited errs */
113 /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */
115 /* ipv6IfIcmpInParmProblems, # of input parameter problem errors */
117 /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */
119 /* ipv6IfIcmpInEchos, # of input echo requests */
120 u_quad_t ifs6_in_echo;
121 /* ipv6IfIcmpInEchoReplies, # of input echo replies */
123 /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */
125 /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */
127 /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */
129 /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advs. */
131 /* ipv6IfIcmpInRedirects, # of input redirects */
133 /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */
135 /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */
137 /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */
139
140 /*
141 * Output statistics. We should solve unresolved routing problem...
142 */
143 /* ipv6IfIcmpOutMsgs, total # of output messages */
144 u_quad_t ifs6_out_msg;
145 /* ipv6IfIcmpOutErrors, # of output error messages */
147 /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */
149 /* ipv6IfIcmpOutAdminProhibs, # of output admin. prohibited errs */
151 /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */
153 /* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */
155 /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */
157 /* ipv6IfIcmpOutEchos, # of output echo requests */
159 /* ipv6IfIcmpOutEchoReplies, # of output echo replies */
161 /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */
163 /* ipv6IfIcmpOutRouterAdvertisements, # of output router advs. */
165 /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */
167 /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advs. */
169 /* ipv6IfIcmpOutRedirects, # of output redirects */
171 /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */
173 /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */
175 /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */
177};
178
179#define SCOPE6_ID_MAX 16
180
181struct in6_ifreq {
182 char ifr_name[IFNAMSIZ];
183 union {
184 struct sockaddr_in6 ifru_addr;
185 struct sockaddr_in6 ifru_dstaddr;
190 caddr_t ifru_data;
196};
197
198#define IN6_IFF_TEMPORARY 0x0080 /* temporary (anonymous) address. */
199#define IN6_IFF_DEPRECATED 0x0010 /* deprecated address */
200
201#define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq)
202#define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq)
203
204#endif // QNETWORKINTERFACE_UIKIT_P_H
205
#define SCOPE6_ID_MAX
struct sockaddr_in6 ifru_addr
u_int32_t ifru_scope_id[SCOPE6_ID_MAX]
struct icmp6_ifstat ifru_icmp6stat
struct in6_ifstat ifru_stat
char ifr_name[IFNAMSIZ]
struct in6_addrlifetime ifru_lifetime
union in6_ifreq::@409 ifr_ifru
struct sockaddr_in6 ifru_dstaddr