Skip to content

Commit 8630d92

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

File tree

2 files changed

+372
-0
lines changed

2 files changed

+372
-0
lines changed

libc-test/semver/android.txt

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,65 @@ IFF_TUN
695695
IFF_UP
696696
IFNAMSIZ
697697
IF_NAMESIZE
698+
IFLA_UNSPEC
699+
IFLA_ADDRESS
700+
IFLA_BROADCAST
701+
IFLA_IFNAME
702+
IFLA_MTU
703+
IFLA_LINK
704+
IFLA_QDISC
705+
IFLA_STATS
706+
IFLA_COST
707+
IFLA_PRIORITY
708+
IFLA_MASTER
709+
IFLA_WIRELESS
710+
IFLA_PROTINFO
711+
IFLA_TXQLEN
712+
IFLA_MAP
713+
IFLA_WEIGHT
714+
IFLA_OPERSTATE
715+
IFLA_LINKMODE
716+
IFLA_LINKINFO
717+
IFLA_NET_NS_PID
718+
IFLA_IFALIAS
719+
IFLA_NUM_VF
720+
IFLA_VFINFO_LIST
721+
IFLA_STATS64
722+
IFLA_VF_PORTS
723+
IFLA_PORT_SELF
724+
IFLA_AF_SPEC
725+
IFLA_GROUP
726+
IFLA_NET_NS_FD
727+
IFLA_EXT_MASK
728+
IFLA_PROMISCUITY
729+
IFLA_NUM_TX_QUEUES
730+
IFLA_NUM_RX_QUEUES
731+
IFLA_CARRIER
732+
IFLA_PHYS_PORT_ID
733+
IFLA_CARRIER_CHANGES
734+
IFLA_PHYS_SWITCH_ID
735+
IFLA_LINK_NETNSID
736+
IFLA_PHYS_PORT_NAME
737+
IFLA_PROTO_DOWN
738+
IFLA_GSO_MAX_SEGS
739+
IFLA_GSO_MAX_SIZE
740+
IFLA_PAD
741+
IFLA_XDP
742+
IFLA_EVENT
743+
IFLA_NEW_NETNSID
744+
IFLA_IF_NETNSID
745+
IFLA_TARGET_NETNSID
746+
IFLA_CARRIER_UP_COUNT
747+
IFLA_CARRIER_DOWN_COUNT
748+
IFLA_NEW_IFINDEX
749+
IFLA_MIN_MTU
750+
IFLA_MAX_MTU
751+
IFLA_INFO_UNSPEC
752+
IFLA_INFO_KIND
753+
IFLA_INFO_DATA
754+
IFLA_INFO_XSTATS
755+
IFLA_INFO_SLAVE_KIND
756+
IFLA_INFO_SLAVE_DATA
698757
IGNBRK
699758
IGNCR
700759
IGNPAR
@@ -1801,6 +1860,126 @@ RTLD_LAZY
18011860
RTLD_LOCAL
18021861
RTLD_NOLOAD
18031862
RTLD_NOW
1863+
TCA_UNSPEC
1864+
TCA_KIND
1865+
TCA_OPTIONS
1866+
TCA_STATS
1867+
TCA_XSTATS
1868+
TCA_RATE
1869+
TCA_FCNT
1870+
TCA_STATS2
1871+
TCA_STAB
1872+
RTM_NEWLINK
1873+
RTM_DELLINK
1874+
RTM_GETLINK
1875+
RTM_SETLINK
1876+
RTM_NEWADDR
1877+
RTM_DELADDR
1878+
RTM_GETADDR
1879+
RTM_NEWROUTE
1880+
RTM_DELROUTE
1881+
RTM_GETROUTE
1882+
RTM_NEWNEIGH
1883+
RTM_DELNEIGH
1884+
RTM_GETNEIGH
1885+
RTM_NEWRULE
1886+
RTM_DELRULE
1887+
RTM_GETRULE
1888+
RTM_NEWQDISC
1889+
RTM_DELQDISC
1890+
RTM_GETQDISC
1891+
RTM_NEWTCLASS
1892+
RTM_DELTCLASS
1893+
RTM_GETTCLASS
1894+
RTM_NEWTFILTER
1895+
RTM_DELTFILTER
1896+
RTM_GETTFILTER
1897+
RTM_NEWACTION
1898+
RTM_DELACTION
1899+
RTM_GETACTION
1900+
RTM_NEWPREFIX
1901+
RTM_GETMULTICAST
1902+
RTM_GETANYCAST
1903+
RTM_NEWNEIGHTBL
1904+
RTM_GETNEIGHTBL
1905+
RTM_SETNEIGHTBL
1906+
RTM_NEWNDUSEROPT
1907+
RTM_NEWADDRLABEL
1908+
RTM_DELADDRLABEL
1909+
RTM_GETADDRLABEL
1910+
RTM_GETDCB
1911+
RTM_SETDCB
1912+
RTM_NEWNETCONF
1913+
RTM_GETNETCONF
1914+
RTM_NEWMDB
1915+
RTM_DELMDB
1916+
RTM_GETMDB
1917+
RTM_NEWNSID
1918+
RTM_DELNSID
1919+
RTM_GETNSID
1920+
RTM_F_NOTIFY
1921+
RTM_F_CLONED
1922+
RTM_F_EQUALIZE
1923+
RTM_F_PREFIX
1924+
RTA_UNSPEC
1925+
RTA_DST
1926+
RTA_SRC
1927+
RTA_IIF
1928+
RTA_OIF
1929+
RTA_GATEWAY
1930+
RTA_PRIORITY
1931+
RTA_PREFSRC
1932+
RTA_METRICS
1933+
RTA_MULTIPATH
1934+
RTA_PROTOINFO
1935+
RTA_FLOW
1936+
RTA_CACHEINFO
1937+
RTA_SESSION
1938+
RTA_MP_ALGO
1939+
RTA_TABLE
1940+
RTA_MARK
1941+
RTA_MFC_STATS
1942+
RTN_UNSPEC
1943+
RTN_UNICAST
1944+
RTN_LOCAL
1945+
RTN_BROADCAST
1946+
RTN_ANYCAST
1947+
RTN_MULTICAST
1948+
RTN_BLACKHOLE
1949+
RTN_UNREACHABLE
1950+
RTN_PROHIBIT
1951+
RTN_THROW
1952+
RTN_NAT
1953+
RTN_XRESOLVE
1954+
RTPROT_UNSPEC
1955+
RTPROT_REDIRECT
1956+
RTPROT_KERNEL
1957+
RTPROT_BOOT
1958+
RTPROT_STATIC
1959+
RT_SCOPE_UNIVERSE
1960+
RT_SCOPE_SITE
1961+
RT_SCOPE_LINK
1962+
RT_SCOPE_HOST
1963+
RT_SCOPE_NOWHERE
1964+
RT_TABLE_UNSPEC
1965+
RT_TABLE_COMPAT
1966+
RT_TABLE_DEFAULT
1967+
RT_TABLE_MAIN
1968+
RT_TABLE_LOCAL
1969+
RTMSG_OVERRUN
1970+
RTMSG_NEWDEVICE
1971+
RTMSG_DELDEVICE
1972+
RTMSG_NEWROUTE
1973+
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
18041983
RUSAGE_CHILDREN
18051984
RUSAGE_SELF
18061985
R_OK

src/unix/linux_like/android/mod.rs

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,199 @@ 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_link.h
2507+
pub const IFLA_UNSPEC: ::c_ushort = 0;
2508+
pub const IFLA_ADDRESS: ::c_ushort = 1;
2509+
pub const IFLA_BROADCAST: ::c_ushort = 2;
2510+
pub const IFLA_IFNAME: ::c_ushort = 3;
2511+
pub const IFLA_MTU: ::c_ushort = 4;
2512+
pub const IFLA_LINK: ::c_ushort = 5;
2513+
pub const IFLA_QDISC: ::c_ushort = 6;
2514+
pub const IFLA_STATS: ::c_ushort = 7;
2515+
pub const IFLA_COST: ::c_ushort = 8;
2516+
pub const IFLA_PRIORITY: ::c_ushort = 9;
2517+
pub const IFLA_MASTER: ::c_ushort = 10;
2518+
pub const IFLA_WIRELESS: ::c_ushort = 11;
2519+
pub const IFLA_PROTINFO: ::c_ushort = 12;
2520+
pub const IFLA_TXQLEN: ::c_ushort = 13;
2521+
pub const IFLA_MAP: ::c_ushort = 14;
2522+
pub const IFLA_WEIGHT: ::c_ushort = 15;
2523+
pub const IFLA_OPERSTATE: ::c_ushort = 16;
2524+
pub const IFLA_LINKMODE: ::c_ushort = 17;
2525+
pub const IFLA_LINKINFO: ::c_ushort = 18;
2526+
pub const IFLA_NET_NS_PID: ::c_ushort = 19;
2527+
pub const IFLA_IFALIAS: ::c_ushort = 20;
2528+
pub const IFLA_NUM_VF: ::c_ushort = 21;
2529+
pub const IFLA_VFINFO_LIST: ::c_ushort = 22;
2530+
pub const IFLA_STATS64: ::c_ushort = 23;
2531+
pub const IFLA_VF_PORTS: ::c_ushort = 24;
2532+
pub const IFLA_PORT_SELF: ::c_ushort = 25;
2533+
pub const IFLA_AF_SPEC: ::c_ushort = 26;
2534+
pub const IFLA_GROUP: ::c_ushort = 27;
2535+
pub const IFLA_NET_NS_FD: ::c_ushort = 28;
2536+
pub const IFLA_EXT_MASK: ::c_ushort = 29;
2537+
pub const IFLA_PROMISCUITY: ::c_ushort = 30;
2538+
pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31;
2539+
pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32;
2540+
pub const IFLA_CARRIER: ::c_ushort = 33;
2541+
pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34;
2542+
pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35;
2543+
pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36;
2544+
pub const IFLA_LINK_NETNSID: ::c_ushort = 37;
2545+
pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38;
2546+
pub const IFLA_PROTO_DOWN: ::c_ushort = 39;
2547+
pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40;
2548+
pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41;
2549+
pub const IFLA_PAD: ::c_ushort = 42;
2550+
pub const IFLA_XDP: ::c_ushort = 43;
2551+
pub const IFLA_EVENT: ::c_ushort = 44;
2552+
pub const IFLA_NEW_NETNSID: ::c_ushort = 45;
2553+
pub const IFLA_IF_NETNSID: ::c_ushort = 46;
2554+
pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID;
2555+
pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47;
2556+
pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48;
2557+
pub const IFLA_NEW_IFINDEX: ::c_ushort = 49;
2558+
pub const IFLA_MIN_MTU: ::c_ushort = 50;
2559+
pub const IFLA_MAX_MTU: ::c_ushort = 51;
2560+
2561+
pub const IFLA_INFO_UNSPEC: ::c_ushort = 0;
2562+
pub const IFLA_INFO_KIND: ::c_ushort = 1;
2563+
pub const IFLA_INFO_DATA: ::c_ushort = 2;
2564+
pub const IFLA_INFO_XSTATS: ::c_ushort = 3;
2565+
pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4;
2566+
pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
2567+
2568+
// linux/rtnetlink.h
2569+
pub const TCA_UNSPEC: ::c_ushort = 0;
2570+
pub const TCA_KIND: ::c_ushort = 1;
2571+
pub const TCA_OPTIONS: ::c_ushort = 2;
2572+
pub const TCA_STATS: ::c_ushort = 3;
2573+
pub const TCA_XSTATS: ::c_ushort = 4;
2574+
pub const TCA_RATE: ::c_ushort = 5;
2575+
pub const TCA_FCNT: ::c_ushort = 6;
2576+
pub const TCA_STATS2: ::c_ushort = 7;
2577+
pub const TCA_STAB: ::c_ushort = 8;
2578+
2579+
pub const RTM_NEWLINK: u16 = 16;
2580+
pub const RTM_DELLINK: u16 = 17;
2581+
pub const RTM_GETLINK: u16 = 18;
2582+
pub const RTM_SETLINK: u16 = 19;
2583+
pub const RTM_NEWADDR: u16 = 20;
2584+
pub const RTM_DELADDR: u16 = 21;
2585+
pub const RTM_GETADDR: u16 = 22;
2586+
pub const RTM_NEWROUTE: u16 = 24;
2587+
pub const RTM_DELROUTE: u16 = 25;
2588+
pub const RTM_GETROUTE: u16 = 26;
2589+
pub const RTM_NEWNEIGH: u16 = 28;
2590+
pub const RTM_DELNEIGH: u16 = 29;
2591+
pub const RTM_GETNEIGH: u16 = 30;
2592+
pub const RTM_NEWRULE: u16 = 32;
2593+
pub const RTM_DELRULE: u16 = 33;
2594+
pub const RTM_GETRULE: u16 = 34;
2595+
pub const RTM_NEWQDISC: u16 = 36;
2596+
pub const RTM_DELQDISC: u16 = 37;
2597+
pub const RTM_GETQDISC: u16 = 38;
2598+
pub const RTM_NEWTCLASS: u16 = 40;
2599+
pub const RTM_DELTCLASS: u16 = 41;
2600+
pub const RTM_GETTCLASS: u16 = 42;
2601+
pub const RTM_NEWTFILTER: u16 = 44;
2602+
pub const RTM_DELTFILTER: u16 = 45;
2603+
pub const RTM_GETTFILTER: u16 = 46;
2604+
pub const RTM_NEWACTION: u16 = 48;
2605+
pub const RTM_DELACTION: u16 = 49;
2606+
pub const RTM_GETACTION: u16 = 50;
2607+
pub const RTM_NEWPREFIX: u16 = 52;
2608+
pub const RTM_GETMULTICAST: u16 = 58;
2609+
pub const RTM_GETANYCAST: u16 = 62;
2610+
pub const RTM_NEWNEIGHTBL: u16 = 64;
2611+
pub const RTM_GETNEIGHTBL: u16 = 66;
2612+
pub const RTM_SETNEIGHTBL: u16 = 67;
2613+
pub const RTM_NEWNDUSEROPT: u16 = 68;
2614+
pub const RTM_NEWADDRLABEL: u16 = 72;
2615+
pub const RTM_DELADDRLABEL: u16 = 73;
2616+
pub const RTM_GETADDRLABEL: u16 = 74;
2617+
pub const RTM_GETDCB: u16 = 78;
2618+
pub const RTM_SETDCB: u16 = 79;
2619+
pub const RTM_NEWNETCONF: u16 = 80;
2620+
pub const RTM_GETNETCONF: u16 = 82;
2621+
pub const RTM_NEWMDB: u16 = 84;
2622+
pub const RTM_DELMDB: u16 = 85;
2623+
pub const RTM_GETMDB: u16 = 86;
2624+
pub const RTM_NEWNSID: u16 = 88;
2625+
pub const RTM_DELNSID: u16 = 89;
2626+
pub const RTM_GETNSID: u16 = 90;
2627+
2628+
pub const RTM_F_NOTIFY: ::c_uint = 0x100;
2629+
pub const RTM_F_CLONED: ::c_uint = 0x200;
2630+
pub const RTM_F_EQUALIZE: ::c_uint = 0x400;
2631+
pub const RTM_F_PREFIX: ::c_uint = 0x800;
2632+
2633+
pub const RTA_UNSPEC: ::c_ushort = 0;
2634+
pub const RTA_DST: ::c_ushort = 1;
2635+
pub const RTA_SRC: ::c_ushort = 2;
2636+
pub const RTA_IIF: ::c_ushort = 3;
2637+
pub const RTA_OIF: ::c_ushort = 4;
2638+
pub const RTA_GATEWAY: ::c_ushort = 5;
2639+
pub const RTA_PRIORITY: ::c_ushort = 6;
2640+
pub const RTA_PREFSRC: ::c_ushort = 7;
2641+
pub const RTA_METRICS: ::c_ushort = 8;
2642+
pub const RTA_MULTIPATH: ::c_ushort = 9;
2643+
pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used
2644+
pub const RTA_FLOW: ::c_ushort = 11;
2645+
pub const RTA_CACHEINFO: ::c_ushort = 12;
2646+
pub const RTA_SESSION: ::c_ushort = 13; // No longer used
2647+
pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used
2648+
pub const RTA_TABLE: ::c_ushort = 15;
2649+
pub const RTA_MARK: ::c_ushort = 16;
2650+
pub const RTA_MFC_STATS: ::c_ushort = 17;
2651+
2652+
pub const RTN_UNSPEC: ::c_uchar = 0;
2653+
pub const RTN_UNICAST: ::c_uchar = 1;
2654+
pub const RTN_LOCAL: ::c_uchar = 2;
2655+
pub const RTN_BROADCAST: ::c_uchar = 3;
2656+
pub const RTN_ANYCAST: ::c_uchar = 4;
2657+
pub const RTN_MULTICAST: ::c_uchar = 5;
2658+
pub const RTN_BLACKHOLE: ::c_uchar = 6;
2659+
pub const RTN_UNREACHABLE: ::c_uchar = 7;
2660+
pub const RTN_PROHIBIT: ::c_uchar = 8;
2661+
pub const RTN_THROW: ::c_uchar = 9;
2662+
pub const RTN_NAT: ::c_uchar = 10;
2663+
pub const RTN_XRESOLVE: ::c_uchar = 11;
2664+
2665+
pub const RTPROT_UNSPEC: ::c_uchar = 0;
2666+
pub const RTPROT_REDIRECT: ::c_uchar = 1;
2667+
pub const RTPROT_KERNEL: ::c_uchar = 2;
2668+
pub const RTPROT_BOOT: ::c_uchar = 3;
2669+
pub const RTPROT_STATIC: ::c_uchar = 4;
2670+
2671+
pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0;
2672+
pub const RT_SCOPE_SITE: ::c_uchar = 200;
2673+
pub const RT_SCOPE_LINK: ::c_uchar = 253;
2674+
pub const RT_SCOPE_HOST: ::c_uchar = 254;
2675+
pub const RT_SCOPE_NOWHERE: ::c_uchar = 255;
2676+
2677+
pub const RT_TABLE_UNSPEC: ::c_uchar = 0;
2678+
pub const RT_TABLE_COMPAT: ::c_uchar = 252;
2679+
pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
2680+
pub const RT_TABLE_MAIN: ::c_uchar = 254;
2681+
pub const RT_TABLE_LOCAL: ::c_uchar = 255;
2682+
2683+
pub const RTMSG_OVERRUN: u32 = ::NLMSG_OVERRUN as u32;
2684+
pub const RTMSG_NEWDEVICE: u32 = 0x11;
2685+
pub const RTMSG_DELDEVICE: u32 = 0x12;
2686+
pub const RTMSG_NEWROUTE: u32 = 0x21;
2687+
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;
2698+
25062699
f! {
25072700
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
25082701
cmsg: *const cmsghdr) -> *mut cmsghdr {

0 commit comments

Comments
 (0)