Skip to content

Commit 30a7a9f

Browse files
committed
Auto merge of #3278 - dragan-cecavac-nordsec:android/add-uapi-linux-neighbour, r=JohnTitor
android: Add kernel/uapi/linux/neighbour.h constants Introduce Android constants defined in https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/kernel/uapi/linux/neighbour.h
2 parents a97640a + ebcb516 commit 30a7a9f

File tree

3 files changed

+174
-0
lines changed

3 files changed

+174
-0
lines changed

libc-test/build.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,26 @@ fn test_android(target: &str) {
18021802
// kernel 5.6 minimum required
18031803
"IPPROTO_MPTCP" | "IPPROTO_ETHERNET" => true,
18041804

1805+
// FIXME: NDK r22 minimum required
1806+
| "FDB_NOTIFY_BIT"
1807+
| "FDB_NOTIFY_INACTIVE_BIT"
1808+
| "NDA_FDB_EXT_ATTRS"
1809+
| "NDA_NH_ID"
1810+
| "NFEA_ACTIVITY_NOTIFY"
1811+
| "NFEA_DONT_REFRESH"
1812+
| "NFEA_UNSPEC" => true,
1813+
1814+
// FIXME: NDK r25 minimum required
1815+
| "NDA_FLAGS_EXT"
1816+
| "NTF_EXT_MANAGED" => true,
1817+
1818+
// FIXME: NDK above r25 required
1819+
| "NDA_NDM_STATE_MASK"
1820+
| "NDA_NDM_FLAGS_MASK"
1821+
| "NDTPA_INTERVAL_PROBE_TIME_MS"
1822+
| "NFQA_UNSPEC"
1823+
| "NTF_EXT_LOCKED" => true,
1824+
18051825
_ => false,
18061826
}
18071827
});

libc-test/semver/android.txt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ FD_ISSET
597597
FD_SET
598598
FD_SETSIZE
599599
FD_ZERO
600+
FDB_NOTIFY_BIT
601+
FDB_NOTIFY_INACTIVE_BIT
600602
FF0
601603
FF1
602604
FFDLY
@@ -1257,6 +1259,54 @@ MS_SYNCHRONOUS
12571259
MS_UNBINDABLE
12581260
NCCS
12591261
NCP_SUPER_MAGIC
1262+
NDA_CACHEINFO
1263+
NDA_DST
1264+
NDA_FDB_EXT_ATTRS
1265+
NDA_FLAGS_EXT
1266+
NDA_IFINDEX
1267+
NDA_LINK_NETNSID
1268+
NDA_LLADDR
1269+
NDA_MASTER
1270+
NDA_NDM_FLAGS_MASK
1271+
NDA_NDM_STATE_MASK
1272+
NDA_NH_ID
1273+
NDA_PORT
1274+
NDA_PROBES
1275+
NDA_PROTOCOL
1276+
NDA_SRC_VNI
1277+
NDA_UNSPEC
1278+
NDA_VLAN
1279+
NDA_VNI
1280+
NDTA_CONFIG
1281+
NDTA_GC_INTERVAL
1282+
NDTA_NAME
1283+
NDTA_PAD
1284+
NDTA_PARMS
1285+
NDTA_STATS
1286+
NDTA_THRESH1
1287+
NDTA_THRESH2
1288+
NDTA_THRESH3
1289+
NDTA_UNSPEC
1290+
NDTPA_ANYCAST_DELAY
1291+
NDTPA_APP_PROBES
1292+
NDTPA_BASE_REACHABLE_TIME
1293+
NDTPA_DELAY_PROBE_TIME
1294+
NDTPA_GC_STALETIME
1295+
NDTPA_IFINDEX
1296+
NDTPA_INTERVAL_PROBE_TIME_MS
1297+
NDTPA_LOCKTIME
1298+
NDTPA_MCAST_PROBES
1299+
NDTPA_MCAST_REPROBES
1300+
NDTPA_PAD
1301+
NDTPA_PROXY_DELAY
1302+
NDTPA_PROXY_QLEN
1303+
NDTPA_QUEUE_LEN
1304+
NDTPA_QUEUE_LENBYTES
1305+
NDTPA_REACHABLE_TIME
1306+
NDTPA_REFCNT
1307+
NDTPA_RETRANS_TIME
1308+
NDTPA_UCAST_PROBES
1309+
NDTPA_UNSPEC
12601310
NETLINK_ADD_MEMBERSHIP
12611311
NETLINK_AUDIT
12621312
NETLINK_BROADCAST_ERROR
@@ -1622,6 +1672,9 @@ NF_VERDICT_FLAG_QUEUE_BYPASS
16221672
NF_VERDICT_MASK
16231673
NF_VERDICT_QBITS
16241674
NF_VERDICT_QMASK
1675+
NFEA_ACTIVITY_NOTIFY
1676+
NFEA_DONT_REFRESH
1677+
NFEA_UNSPEC
16251678
NI_DGRAM
16261679
NI_MAXHOST
16271680
NI_MAXSERV
@@ -1657,6 +1710,25 @@ NLM_F_REPLACE
16571710
NLM_F_REQUEST
16581711
NLM_F_ROOT
16591712
NOFLSH
1713+
NTF_EXT_LEARNED
1714+
NTF_EXT_LOCKED
1715+
NTF_EXT_MANAGED
1716+
NTF_MASTER
1717+
NTF_OFFLOADED
1718+
NTF_PROXY
1719+
NTF_ROUTER
1720+
NTF_SELF
1721+
NTF_STICKY
1722+
NTF_USE
1723+
NUD_DELAY
1724+
NUD_FAILED
1725+
NUD_INCOMPLETE
1726+
NUD_NOARP
1727+
NUD_NONE
1728+
NUD_PERMANENT
1729+
NUD_PROBE
1730+
NUD_REACHABLE
1731+
NUD_STALE
16601732
OCRNL
16611733
OFDEL
16621734
OFILL

src/unix/linux_like/android/mod.rs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,6 +2581,88 @@ pub const ETH_P_XDSA: ::c_int = 0x00F8;
25812581
/* see rust-lang/libc#924 pub const ETH_P_MAP: ::c_int = 0x00F9;*/
25822582
// end android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
25832583

2584+
// start android/platform/bionic/libc/kernel/uapi/linux/neighbour.h
2585+
pub const NDA_UNSPEC: ::c_ushort = 0;
2586+
pub const NDA_DST: ::c_ushort = 1;
2587+
pub const NDA_LLADDR: ::c_ushort = 2;
2588+
pub const NDA_CACHEINFO: ::c_ushort = 3;
2589+
pub const NDA_PROBES: ::c_ushort = 4;
2590+
pub const NDA_VLAN: ::c_ushort = 5;
2591+
pub const NDA_PORT: ::c_ushort = 6;
2592+
pub const NDA_VNI: ::c_ushort = 7;
2593+
pub const NDA_IFINDEX: ::c_ushort = 8;
2594+
pub const NDA_MASTER: ::c_ushort = 9;
2595+
pub const NDA_LINK_NETNSID: ::c_ushort = 10;
2596+
pub const NDA_SRC_VNI: ::c_ushort = 11;
2597+
pub const NDA_PROTOCOL: ::c_ushort = 12;
2598+
pub const NDA_NH_ID: ::c_ushort = 13;
2599+
pub const NDA_FDB_EXT_ATTRS: ::c_ushort = 14;
2600+
pub const NDA_FLAGS_EXT: ::c_ushort = 15;
2601+
pub const NDA_NDM_STATE_MASK: ::c_ushort = 16;
2602+
pub const NDA_NDM_FLAGS_MASK: ::c_ushort = 17;
2603+
2604+
pub const NTF_USE: u8 = 0x01;
2605+
pub const NTF_SELF: u8 = 0x02;
2606+
pub const NTF_MASTER: u8 = 0x04;
2607+
pub const NTF_PROXY: u8 = 0x08;
2608+
pub const NTF_EXT_LEARNED: u8 = 0x10;
2609+
pub const NTF_OFFLOADED: u8 = 0x20;
2610+
pub const NTF_STICKY: u8 = 0x40;
2611+
pub const NTF_ROUTER: u8 = 0x80;
2612+
2613+
pub const NTF_EXT_MANAGED: u8 = 0x01;
2614+
pub const NTF_EXT_LOCKED: u8 = 0x02;
2615+
2616+
pub const NUD_NONE: u16 = 0x00;
2617+
pub const NUD_INCOMPLETE: u16 = 0x01;
2618+
pub const NUD_REACHABLE: u16 = 0x02;
2619+
pub const NUD_STALE: u16 = 0x04;
2620+
pub const NUD_DELAY: u16 = 0x08;
2621+
pub const NUD_PROBE: u16 = 0x10;
2622+
pub const NUD_FAILED: u16 = 0x20;
2623+
pub const NUD_NOARP: u16 = 0x40;
2624+
pub const NUD_PERMANENT: u16 = 0x80;
2625+
2626+
pub const NDTPA_UNSPEC: ::c_ushort = 0;
2627+
pub const NDTPA_IFINDEX: ::c_ushort = 1;
2628+
pub const NDTPA_REFCNT: ::c_ushort = 2;
2629+
pub const NDTPA_REACHABLE_TIME: ::c_ushort = 3;
2630+
pub const NDTPA_BASE_REACHABLE_TIME: ::c_ushort = 4;
2631+
pub const NDTPA_RETRANS_TIME: ::c_ushort = 5;
2632+
pub const NDTPA_GC_STALETIME: ::c_ushort = 6;
2633+
pub const NDTPA_DELAY_PROBE_TIME: ::c_ushort = 7;
2634+
pub const NDTPA_QUEUE_LEN: ::c_ushort = 8;
2635+
pub const NDTPA_APP_PROBES: ::c_ushort = 9;
2636+
pub const NDTPA_UCAST_PROBES: ::c_ushort = 10;
2637+
pub const NDTPA_MCAST_PROBES: ::c_ushort = 11;
2638+
pub const NDTPA_ANYCAST_DELAY: ::c_ushort = 12;
2639+
pub const NDTPA_PROXY_DELAY: ::c_ushort = 13;
2640+
pub const NDTPA_PROXY_QLEN: ::c_ushort = 14;
2641+
pub const NDTPA_LOCKTIME: ::c_ushort = 15;
2642+
pub const NDTPA_QUEUE_LENBYTES: ::c_ushort = 16;
2643+
pub const NDTPA_MCAST_REPROBES: ::c_ushort = 17;
2644+
pub const NDTPA_PAD: ::c_ushort = 18;
2645+
pub const NDTPA_INTERVAL_PROBE_TIME_MS: ::c_ushort = 19;
2646+
2647+
pub const NDTA_UNSPEC: ::c_ushort = 0;
2648+
pub const NDTA_NAME: ::c_ushort = 1;
2649+
pub const NDTA_THRESH1: ::c_ushort = 2;
2650+
pub const NDTA_THRESH2: ::c_ushort = 3;
2651+
pub const NDTA_THRESH3: ::c_ushort = 4;
2652+
pub const NDTA_CONFIG: ::c_ushort = 5;
2653+
pub const NDTA_PARMS: ::c_ushort = 6;
2654+
pub const NDTA_STATS: ::c_ushort = 7;
2655+
pub const NDTA_GC_INTERVAL: ::c_ushort = 8;
2656+
pub const NDTA_PAD: ::c_ushort = 9;
2657+
2658+
pub const FDB_NOTIFY_BIT: u16 = 0x01;
2659+
pub const FDB_NOTIFY_INACTIVE_BIT: u16 = 0x02;
2660+
2661+
pub const NFEA_UNSPEC: ::c_ushort = 0;
2662+
pub const NFEA_ACTIVITY_NOTIFY: ::c_ushort = 1;
2663+
pub const NFEA_DONT_REFRESH: ::c_ushort = 2;
2664+
// end android/platform/bionic/libc/kernel/uapi/linux/neighbour.h
2665+
25842666
pub const SIOCADDRT: ::c_ulong = 0x0000890B;
25852667
pub const SIOCDELRT: ::c_ulong = 0x0000890C;
25862668
pub const SIOCGIFNAME: ::c_ulong = 0x00008910;

0 commit comments

Comments
 (0)