Skip to content

Commit f5b4740

Browse files
committed
Add rtnetlink.h, if_addr.h, if_link.h header to Android
1 parent 8630d92 commit f5b4740

File tree

3 files changed

+40
-21
lines changed

3 files changed

+40
-21
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,10 @@ fn test_android(target: &str) {
15821582
"linux/fs.h",
15831583
"linux/genetlink.h",
15841584
"linux/if_alg.h",
1585+
"linux/if_addr.h",
15851586
"linux/if_ether.h",
1587+
"linux/if_link.h",
1588+
"linux/rtnetlink.h",
15861589
"linux/if_tun.h",
15871590
"linux/magic.h",
15881591
"linux/memfd.h",

libc-test/semver/android.txt

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,23 @@ IFF_TUN
695695
IFF_UP
696696
IFNAMSIZ
697697
IF_NAMESIZE
698+
IFA_UNSPEC
699+
IFA_ADDRESS
700+
IFA_LOCAL
701+
IFA_LABEL
702+
IFA_BROADCAST
703+
IFA_ANYCAST
704+
IFA_CACHEINFO
705+
IFA_MULTICAST
706+
IFA_F_SECONDARY
707+
IFA_F_TEMPORARY
708+
IFA_F_NODAD
709+
IFA_F_OPTIMISTIC
710+
IFA_F_DADFAILED
711+
IFA_F_HOMEADDRESS
712+
IFA_F_DEPRECATED
713+
IFA_F_TENTATIVE
714+
IFA_F_PERMANENT
698715
IFLA_UNSPEC
699716
IFLA_ADDRESS
700717
IFLA_BROADCAST
@@ -1966,20 +1983,10 @@ RT_TABLE_COMPAT
19661983
RT_TABLE_DEFAULT
19671984
RT_TABLE_MAIN
19681985
RT_TABLE_LOCAL
1969-
RTMSG_OVERRUN
19701986
RTMSG_NEWDEVICE
19711987
RTMSG_DELDEVICE
19721988
RTMSG_NEWROUTE
19731989
RTMSG_DELROUTE
1974-
RTMSG_NEWRULE
1975-
RTMSG_DELRULE
1976-
RTMSG_CONTROL
1977-
RTMSG_AR_FAILED
1978-
MAX_ADDR_LEN
1979-
ARPD_UPDATE
1980-
ARPD_LOOKUP
1981-
ARPD_FLUSH
1982-
ATF_MAGIC
19831990
RUSAGE_CHILDREN
19841991
RUSAGE_SELF
19851992
R_OK

src/unix/linux_like/android/mod.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,26 @@ pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
25032503
pub const PR_GET_SECCOMP: ::c_int = 21;
25042504
pub const PR_SET_SECCOMP: ::c_int = 22;
25052505

2506+
// linux/if_addr.h
2507+
pub const IFA_UNSPEC: ::c_ushort = 0;
2508+
pub const IFA_ADDRESS: ::c_ushort = 1;
2509+
pub const IFA_LOCAL: ::c_ushort = 2;
2510+
pub const IFA_LABEL: ::c_ushort = 3;
2511+
pub const IFA_BROADCAST: ::c_ushort = 4;
2512+
pub const IFA_ANYCAST: ::c_ushort = 5;
2513+
pub const IFA_CACHEINFO: ::c_ushort = 6;
2514+
pub const IFA_MULTICAST: ::c_ushort = 7;
2515+
2516+
pub const IFA_F_SECONDARY: u32 = 0x01;
2517+
pub const IFA_F_TEMPORARY: u32 = 0x01;
2518+
pub const IFA_F_NODAD: u32 = 0x02;
2519+
pub const IFA_F_OPTIMISTIC: u32 = 0x04;
2520+
pub const IFA_F_DADFAILED: u32 = 0x08;
2521+
pub const IFA_F_HOMEADDRESS: u32 = 0x10;
2522+
pub const IFA_F_DEPRECATED: u32 = 0x20;
2523+
pub const IFA_F_TENTATIVE: u32 = 0x40;
2524+
pub const IFA_F_PERMANENT: u32 = 0x80;
2525+
25062526
// linux/if_link.h
25072527
pub const IFLA_UNSPEC: ::c_ushort = 0;
25082528
pub const IFLA_ADDRESS: ::c_ushort = 1;
@@ -2680,21 +2700,10 @@ pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
26802700
pub const RT_TABLE_MAIN: ::c_uchar = 254;
26812701
pub const RT_TABLE_LOCAL: ::c_uchar = 255;
26822702

2683-
pub const RTMSG_OVERRUN: u32 = ::NLMSG_OVERRUN as u32;
26842703
pub const RTMSG_NEWDEVICE: u32 = 0x11;
26852704
pub const RTMSG_DELDEVICE: u32 = 0x12;
26862705
pub const RTMSG_NEWROUTE: u32 = 0x21;
26872706
pub const RTMSG_DELROUTE: u32 = 0x22;
2688-
pub const RTMSG_NEWRULE: u32 = 0x31;
2689-
pub const RTMSG_DELRULE: u32 = 0x32;
2690-
pub const RTMSG_CONTROL: u32 = 0x40;
2691-
pub const RTMSG_AR_FAILED: u32 = 0x51;
2692-
2693-
pub const MAX_ADDR_LEN: usize = 7;
2694-
pub const ARPD_UPDATE: ::c_ushort = 0x01;
2695-
pub const ARPD_LOOKUP: ::c_ushort = 0x02;
2696-
pub const ARPD_FLUSH: ::c_ushort = 0x03;
2697-
pub const ATF_MAGIC: ::c_int = 0x80;
26982707

26992708
f! {
27002709
pub fn CMSG_NXTHDR(mhdr: *const msghdr,

0 commit comments

Comments
 (0)