Merge "Update"

This commit is contained in:
Jean-Baptiste Queru 2011-02-11 12:17:21 -08:00 committed by Android Code Review
commit 69d6c2ccd9
4 changed files with 223 additions and 62 deletions

View File

@ -77,6 +77,7 @@
#define ARPHRD_PHONET 820
#define ARPHRD_PHONET_PIPE 821
#define ARPHRD_CAIF 822
#define ARPHRD_VOID 0xFFFF
#define ARPHRD_NONE 0xFFFE
@ -111,8 +112,7 @@ struct arpreq_old {
#define ATF_NETMASK 0x20
#define ATF_DONTPUB 0x40
struct arphdr
{
struct arphdr {
__be16 ar_hrd;
__be16 ar_pro;
unsigned char ar_hln;
@ -122,3 +122,4 @@ struct arphdr
};
#endif

View File

@ -15,8 +15,7 @@
#include <linux/types.h>
#include <linux/netlink.h>
struct rtnl_link_stats
{
struct rtnl_link_stats {
__u32 rx_packets;
__u32 tx_packets;
__u32 rx_bytes;
@ -45,8 +44,36 @@ struct rtnl_link_stats
__u32 tx_compressed;
};
struct rtnl_link_ifmap
{
struct rtnl_link_stats64 {
__u64 rx_packets;
__u64 tx_packets;
__u64 rx_bytes;
__u64 tx_bytes;
__u64 rx_errors;
__u64 tx_errors;
__u64 rx_dropped;
__u64 tx_dropped;
__u64 multicast;
__u64 collisions;
__u64 rx_length_errors;
__u64 rx_over_errors;
__u64 rx_crc_errors;
__u64 rx_frame_errors;
__u64 rx_fifo_errors;
__u64 rx_missed_errors;
__u64 tx_aborted_errors;
__u64 tx_carrier_errors;
__u64 tx_fifo_errors;
__u64 tx_heartbeat_errors;
__u64 tx_window_errors;
__u64 rx_compressed;
__u64 tx_compressed;
};
struct rtnl_link_ifmap {
__u64 mem_start;
__u64 mem_end;
__u64 base_addr;
@ -55,8 +82,7 @@ struct rtnl_link_ifmap
__u8 port;
};
enum
{
enum {
IFLA_UNSPEC,
IFLA_ADDRESS,
IFLA_BROADCAST,
@ -87,6 +113,11 @@ enum
#define IFLA_LINKINFO IFLA_LINKINFO
IFLA_NET_NS_PID,
IFLA_IFALIAS,
IFLA_NUM_VF,
IFLA_VFINFO_LIST,
IFLA_STATS64,
IFLA_VF_PORTS,
IFLA_PORT_SELF,
__IFLA_MAX
};
@ -95,8 +126,7 @@ enum
#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
enum
{
enum {
IFLA_INET6_UNSPEC,
IFLA_INET6_FLAGS,
IFLA_INET6_CONF,
@ -109,16 +139,14 @@ enum
#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
struct ifla_cacheinfo
{
struct ifla_cacheinfo {
__u32 max_reasm_len;
__u32 tstamp;
__u32 reachable_time;
__u32 retrans_time;
};
enum
{
enum {
IFLA_INFO_UNSPEC,
IFLA_INFO_KIND,
IFLA_INFO_DATA,
@ -128,8 +156,7 @@ enum
#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
enum
{
enum {
IFLA_VLAN_UNSPEC,
IFLA_VLAN_ID,
IFLA_VLAN_FLAGS,
@ -145,8 +172,7 @@ struct ifla_vlan_flags {
__u32 mask;
};
enum
{
enum {
IFLA_VLAN_QOS_UNSPEC,
IFLA_VLAN_QOS_MAPPING,
__IFLA_VLAN_QOS_MAX
@ -154,10 +180,123 @@ enum
#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
struct ifla_vlan_qos_mapping
{
struct ifla_vlan_qos_mapping {
__u32 from;
__u32 to;
};
enum {
IFLA_MACVLAN_UNSPEC,
IFLA_MACVLAN_MODE,
__IFLA_MACVLAN_MAX,
};
#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
enum macvlan_mode {
MACVLAN_MODE_PRIVATE = 1,
MACVLAN_MODE_VEPA = 2,
MACVLAN_MODE_BRIDGE = 4,
};
enum {
IFLA_VF_INFO_UNSPEC,
IFLA_VF_INFO,
__IFLA_VF_INFO_MAX,
};
#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
enum {
IFLA_VF_UNSPEC,
IFLA_VF_MAC,
IFLA_VF_VLAN,
IFLA_VF_TX_RATE,
__IFLA_VF_MAX,
};
#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
struct ifla_vf_mac {
__u32 vf;
__u8 mac[32];
};
struct ifla_vf_vlan {
__u32 vf;
__u32 vlan;
__u32 qos;
};
struct ifla_vf_tx_rate {
__u32 vf;
__u32 rate;
};
struct ifla_vf_info {
__u32 vf;
__u8 mac[32];
__u32 vlan;
__u32 qos;
__u32 tx_rate;
};
enum {
IFLA_VF_PORT_UNSPEC,
IFLA_VF_PORT,
__IFLA_VF_PORT_MAX,
};
#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
enum {
IFLA_PORT_UNSPEC,
IFLA_PORT_VF,
IFLA_PORT_PROFILE,
IFLA_PORT_VSI_TYPE,
IFLA_PORT_INSTANCE_UUID,
IFLA_PORT_HOST_UUID,
IFLA_PORT_REQUEST,
IFLA_PORT_RESPONSE,
__IFLA_PORT_MAX,
};
#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
#define PORT_PROFILE_MAX 40
#define PORT_UUID_MAX 16
#define PORT_SELF_VF -1
enum {
PORT_REQUEST_PREASSOCIATE = 0,
PORT_REQUEST_PREASSOCIATE_RR,
PORT_REQUEST_ASSOCIATE,
PORT_REQUEST_DISASSOCIATE,
};
enum {
PORT_VDP_RESPONSE_SUCCESS = 0,
PORT_VDP_RESPONSE_INVALID_FORMAT,
PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
PORT_VDP_RESPONSE_UNUSED_VTID,
PORT_VDP_RESPONSE_VTID_VIOLATION,
PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
PORT_VDP_RESPONSE_OUT_OF_SYNC,
PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
PORT_PROFILE_RESPONSE_INPROGRESS,
PORT_PROFILE_RESPONSE_INVALID,
PORT_PROFILE_RESPONSE_BADSTATE,
PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
PORT_PROFILE_RESPONSE_ERROR,
};
struct ifla_port_vsi {
__u8 vsi_mgr_id;
__u8 vsi_type_id[3];
__u8 vsi_type_version;
__u8 pad[3];
};
#endif

View File

@ -12,6 +12,10 @@
#ifndef __IF_TUN_H
#define __IF_TUN_H
#include <linux/types.h>
#include <linux/if_ether.h>
#include <linux/filter.h>
#define TUN_READQ_SIZE 500
#define TUN_TUN_DEV 0x0001
@ -23,6 +27,7 @@
#define TUN_NO_PI 0x0040
#define TUN_ONE_QUEUE 0x0080
#define TUN_PERSIST 0x0100
#define TUN_VNET_HDR 0x0200
#define TUNSETNOCSUM _IOW('T', 200, int)
#define TUNSETDEBUG _IOW('T', 201, int)
@ -30,16 +35,43 @@
#define TUNSETPERSIST _IOW('T', 203, int)
#define TUNSETOWNER _IOW('T', 204, int)
#define TUNSETLINK _IOW('T', 205, int)
#define TUNSETGROUP _IOW('T', 206, int)
#define TUNGETFEATURES _IOR('T', 207, unsigned int)
#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
#define TUNGETIFF _IOR('T', 210, unsigned int)
#define TUNGETSNDBUF _IOR('T', 211, int)
#define TUNSETSNDBUF _IOW('T', 212, int)
#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
#define TUNGETVNETHDRSZ _IOR('T', 215, int)
#define TUNSETVNETHDRSZ _IOW('T', 216, int)
#define IFF_TUN 0x0001
#define IFF_TAP 0x0002
#define IFF_NO_PI 0x1000
#define IFF_ONE_QUEUE 0x2000
#define IFF_VNET_HDR 0x4000
#define IFF_TUN_EXCL 0x8000
#define TUN_F_CSUM 0x01
#define TUN_F_TSO4 0x02
#define TUN_F_TSO6 0x04
#define TUN_F_TSO_ECN 0x08
#define TUN_F_UFO 0x10
struct tun_pi {
unsigned short flags;
unsigned short proto;
};
#define TUN_PKT_STRIP 0x0001
struct tun_pi {
__u16 flags;
__be16 proto;
};
#define TUN_FLT_ALLMULTI 0x0001
struct tun_filter {
__u16 flags;
__u16 count;
__u8 addr[0][ETH_ALEN];
};
#endif

View File

@ -18,6 +18,10 @@
#include <linux/if_addr.h>
#include <linux/neighbour.h>
#define RTNL_FAMILY_IPMR 128
#define RTNL_FAMILY_IP6MR 129
#define RTNL_FAMILY_MAX 129
enum {
RTM_BASE = 16,
#define RTM_BASE RTM_BASE
@ -126,8 +130,7 @@ enum {
#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
struct rtattr
{
struct rtattr {
unsigned short rta_len;
unsigned short rta_type;
};
@ -141,8 +144,7 @@ struct rtattr
#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
struct rtmsg
{
struct rtmsg {
unsigned char rtm_family;
unsigned char rtm_dst_len;
unsigned char rtm_src_len;
@ -156,8 +158,7 @@ struct rtmsg
unsigned rtm_flags;
};
enum
{
enum {
RTN_UNSPEC,
RTN_UNICAST,
RTN_LOCAL,
@ -191,8 +192,7 @@ enum
#define RTPROT_NTK 15
#define RTPROT_DHCP 16
enum rt_scope_t
{
enum rt_scope_t {
RT_SCOPE_UNIVERSE=0,
RT_SCOPE_SITE=200,
@ -206,8 +206,7 @@ enum rt_scope_t
#define RTM_F_EQUALIZE 0x400
#define RTM_F_PREFIX 0x800
enum rt_class_t
{
enum rt_class_t {
RT_TABLE_UNSPEC=0,
RT_TABLE_COMPAT=252,
@ -217,8 +216,7 @@ enum rt_class_t
RT_TABLE_MAX=0xFFFFFFFF
};
enum rtattr_type_t
{
enum rtattr_type_t {
RTA_UNSPEC,
RTA_DST,
RTA_SRC,
@ -235,6 +233,7 @@ enum rtattr_type_t
RTA_SESSION,
RTA_MP_ALGO,
RTA_TABLE,
RTA_MARK,
__RTA_MAX
};
@ -243,8 +242,7 @@ enum rtattr_type_t
#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
struct rtnexthop
{
struct rtnexthop {
unsigned short rtnh_len;
unsigned char rtnh_flags;
unsigned char rtnh_hops;
@ -263,8 +261,7 @@ struct rtnexthop
#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
struct rta_cacheinfo
{
struct rta_cacheinfo {
__u32 rta_clntref;
__u32 rta_lastuse;
__s32 rta_expires;
@ -277,8 +274,7 @@ struct rta_cacheinfo
__u32 rta_tsage;
};
enum
{
enum {
RTAX_UNSPEC,
#define RTAX_UNSPEC RTAX_UNSPEC
RTAX_LOCK,
@ -307,6 +303,8 @@ enum
#define RTAX_FEATURES RTAX_FEATURES
RTAX_RTO_MIN,
#define RTAX_RTO_MIN RTAX_RTO_MIN
RTAX_INITRWND,
#define RTAX_INITRWND RTAX_INITRWND
__RTAX_MAX
};
@ -317,8 +315,7 @@ enum
#define RTAX_FEATURE_TIMESTAMP 0x00000004
#define RTAX_FEATURE_ALLFRAG 0x00000008
struct rta_session
{
struct rta_session {
__u8 proto;
__u8 pad1;
__u16 pad2;
@ -339,13 +336,11 @@ struct rta_session
} u;
};
struct rtgenmsg
{
struct rtgenmsg {
unsigned char rtgen_family;
};
struct ifinfomsg
{
struct ifinfomsg {
unsigned char ifi_family;
unsigned char __ifi_pad;
unsigned short ifi_type;
@ -354,8 +349,7 @@ struct ifinfomsg
unsigned ifi_change;
};
struct prefixmsg
{
struct prefixmsg {
unsigned char prefix_family;
unsigned char prefix_pad1;
unsigned short prefix_pad2;
@ -376,14 +370,12 @@ enum
#define PREFIX_MAX (__PREFIX_MAX - 1)
struct prefix_cacheinfo
{
struct prefix_cacheinfo {
__u32 preferred_time;
__u32 valid_time;
};
struct tcmsg
{
struct tcmsg {
unsigned char tcm_family;
unsigned char tcm__pad1;
unsigned short tcm__pad2;
@ -393,8 +385,7 @@ struct tcmsg
__u32 tcm_info;
};
enum
{
enum {
TCA_UNSPEC,
TCA_KIND,
TCA_OPTIONS,
@ -412,8 +403,7 @@ enum
#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
struct nduseroptmsg
{
struct nduseroptmsg {
unsigned char nduseropt_family;
unsigned char nduseropt_pad1;
unsigned short nduseropt_opts_len;
@ -425,8 +415,7 @@ struct nduseroptmsg
};
enum
{
enum {
NDUSEROPT_UNSPEC,
NDUSEROPT_SRCADDR,
__NDUSEROPT_MAX
@ -503,8 +492,7 @@ enum rtnetlink_groups {
};
#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
struct tcamsg
{
struct tcamsg {
unsigned char tca_family;
unsigned char tca__pad1;
unsigned short tca__pad2;
@ -515,3 +503,4 @@ struct tcamsg
#define TCAA_MAX 1
#endif