Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/shemminger/iproute2
  • Loading branch information
Dave Taht committed Jan 22, 2012
2 parents fc38a22 + db4a7f1 commit 5662ed6
Show file tree
Hide file tree
Showing 34 changed files with 453 additions and 83 deletions.
1 change: 1 addition & 0 deletions include/linux/if.h
Expand Up @@ -79,6 +79,7 @@
#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
* skbs on transmit */
#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
#define IFF_TEAM_PORT 0x40000 /* device used as team port */

#define IF_GET_IFACE 0x0001 /* for querying only */
#define IF_GET_PROTO 0x0002
Expand Down
1 change: 1 addition & 0 deletions include/linux/if_ether.h
Expand Up @@ -79,6 +79,7 @@
#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
#define ETH_P_TIPC 0x88CA /* TIPC */
#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
Expand Down
2 changes: 1 addition & 1 deletion include/linux/if_vlan.h
Expand Up @@ -54,7 +54,7 @@ struct vlan_ioctl_args {
unsigned int skb_priority;
unsigned int name_type;
unsigned int bind_type;
unsigned int flag; /* Matches vlan_dev_info flags */
unsigned int flag; /* Matches vlan_dev_priv flags */
} u;

short vlan_qos;
Expand Down
12 changes: 11 additions & 1 deletion include/linux/inet_diag.h
Expand Up @@ -34,6 +34,15 @@ struct inet_diag_req {
__u32 idiag_dbs; /* Tables to dump (NI) */
};

struct inet_diag_req_v2 {
__u8 sdiag_family;
__u8 sdiag_protocol;
__u8 idiag_ext;
__u8 pad;
__u32 idiag_states;
struct inet_diag_sockid id;
};

enum {
INET_DIAG_REQ_NONE,
INET_DIAG_REQ_BYTECODE,
Expand Down Expand Up @@ -99,9 +108,10 @@ enum {
INET_DIAG_CONG,
INET_DIAG_TOS,
INET_DIAG_TCLASS,
INET_DIAG_SKMEMINFO,
};

#define INET_DIAG_MAX INET_DIAG_TCLASS
#define INET_DIAG_MAX INET_DIAG_SKMEMINFO


/* INET_DIAG_MEM */
Expand Down
1 change: 1 addition & 0 deletions include/linux/neighbour.h
Expand Up @@ -116,6 +116,7 @@ enum {
NDTPA_PROXY_DELAY, /* u64, msecs */
NDTPA_PROXY_QLEN, /* u32 */
NDTPA_LOCKTIME, /* u64, msecs */
NDTPA_QUEUE_LENBYTES, /* u32 */
__NDTPA_MAX
};
#define NDTPA_MAX (__NDTPA_MAX - 1)
Expand Down
4 changes: 3 additions & 1 deletion include/linux/netlink.h
Expand Up @@ -8,7 +8,7 @@
#define NETLINK_UNUSED 1 /* Unused number */
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
#define NETLINK_FIREWALL 3 /* Firewalling hook */
#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
#define NETLINK_XFRM 6 /* ipsec */
#define NETLINK_SELINUX 7 /* SELinux event notifications */
Expand All @@ -27,6 +27,8 @@
#define NETLINK_RDMA 20
#define NETLINK_CRYPTO 21 /* Crypto layer */

#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG

#define MAX_LINKS 32

struct sockaddr_nl {
Expand Down
52 changes: 41 additions & 11 deletions include/linux/pkt_sched.h
Expand Up @@ -162,25 +162,44 @@ struct tc_sfq_qopt {
unsigned flows; /* Maximal number of flows */
};

struct tc_sfqred_stats {
__u32 prob_drop; /* Early drops, below max threshold */
__u32 forced_drop; /* Early drops, after max threshold */
__u32 prob_mark; /* Marked packets, below max threshold */
__u32 forced_mark; /* Marked packets, after max threshold */
__u32 prob_mark_head; /* Marked packets, below max threshold */
__u32 forced_mark_head;/* Marked packets, after max threshold */
};

struct tc_sfq_qopt_v1 {
struct tc_sfq_qopt v0;
unsigned int depth; /* max number of packets per flow */
unsigned int headdrop;
/* SFQRED parameters */
__u32 limit; /* HARD maximal flow queue length (bytes) */
__u32 qth_min; /* Min average length threshold (bytes) */
__u32 qth_max; /* Max average length threshold (bytes) */
unsigned char Wlog; /* log(W) */
unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
unsigned char Scell_log; /* cell size for idle damping */
unsigned char flags;
__u32 max_P; /* probability, high resolution */
/* SFQRED stats */
struct tc_sfqred_stats stats;
};


struct tc_sfq_xstats {
__s32 allot;
};

/*
* NOTE: limit, divisor and flows are hardwired to code at the moment.
*
* limit=flows=128, divisor=1024;
*
* The only reason for this is efficiency, it is possible
* to change these parameters in compile time.
*/

/* RED section */

enum {
TCA_RED_UNSPEC,
TCA_RED_PARMS,
TCA_RED_STAB,
TCA_RED_MAX_P,
__TCA_RED_MAX,
};

Expand All @@ -194,8 +213,9 @@ struct tc_red_qopt {
unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
unsigned char Scell_log; /* cell size for idle damping */
unsigned char flags;
#define TC_RED_ECN 1
#define TC_RED_HARDDROP 2
#define TC_RED_ECN 1
#define TC_RED_HARDDROP 2
#define TC_RED_ADAPTATIVE 4
};

struct tc_red_xstats {
Expand All @@ -214,6 +234,7 @@ enum {
TCA_GRED_PARMS,
TCA_GRED_STAB,
TCA_GRED_DPS,
TCA_GRED_MAX_P,
__TCA_GRED_MAX,
};

Expand Down Expand Up @@ -253,6 +274,7 @@ enum {
TCA_CHOKE_UNSPEC,
TCA_CHOKE_PARMS,
TCA_CHOKE_STAB,
TCA_CHOKE_MAX_P,
__TCA_CHOKE_MAX,
};

Expand Down Expand Up @@ -465,6 +487,7 @@ enum {
TCA_NETEM_REORDER,
TCA_NETEM_CORRUPT,
TCA_NETEM_LOSS,
TCA_NETEM_RATE,
__TCA_NETEM_MAX,
};

Expand Down Expand Up @@ -495,6 +518,13 @@ struct tc_netem_corrupt {
__u32 correlation;
};

struct tc_netem_rate {
__u32 rate; /* byte/s */
__s32 packet_overhead;
__u32 cell_size;
__s32 cell_overhead;
};

enum {
NETEM_LOSS_UNSPEC,
NETEM_LOSS_GI, /* General Intuitive - 4 state model */
Expand Down
2 changes: 1 addition & 1 deletion include/linux/types.h
Expand Up @@ -38,7 +38,7 @@ typedef __u32 __bitwise __wsum;
* aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
* common 32/64-bit compat problems.
* 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
* architectures) and to 8-byte boundaries on 64-bit architetures. The new
* architectures) and to 8-byte boundaries on 64-bit architectures. The new
* aligned_64 type enforces 8-byte alignment so that structs containing
* aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
* No conversions are necessary between 32-bit user-space and a 64-bit kernel.
Expand Down
1 change: 1 addition & 0 deletions include/utils.h
Expand Up @@ -85,6 +85,7 @@ extern int get_time_rtt(unsigned *val, const char *arg, int *raw);
#define get_short get_s16
extern int get_u64(__u64 *val, const char *arg, int base);
extern int get_u32(__u32 *val, const char *arg, int base);
extern int get_s32(__s32 *val, const char *arg, int base);
extern int get_u16(__u16 *val, const char *arg, int base);
extern int get_s16(__s16 *val, const char *arg, int base);
extern int get_u8(__u8 *val, const char *arg, int base);
Expand Down
2 changes: 1 addition & 1 deletion ip/ip.c
Expand Up @@ -72,8 +72,8 @@ static const struct cmd {
{ "neighbour", do_ipneigh },
{ "ntable", do_ipntable },
{ "ntbl", do_ipntable },
{ "l2tp", do_ipl2tp },
{ "link", do_iplink },
{ "l2tp", do_ipl2tp },
{ "tunnel", do_iptunnel },
{ "tunl", do_iptunnel },
{ "tuntap", do_iptuntap },
Expand Down
7 changes: 0 additions & 7 deletions ip/ipl2tp.c
Expand Up @@ -23,13 +23,6 @@
#include <linux/if_arp.h>
#include <linux/ip.h>

#include <netlink/netlink.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/family.h>
#include <netlink/genl/mngt.h>
#include <netlink/genl/ctrl.h>
#include <netlink/utils.h>

#include <linux/genetlink.h>
#include <linux/l2tp.h>

Expand Down
4 changes: 2 additions & 2 deletions lib/libnetlink.c
Expand Up @@ -99,7 +99,7 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = sizeof(req);
req.nlh.nlmsg_type = type;
req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST;
req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
req.g.rtgen_family = family;
Expand Down Expand Up @@ -162,7 +162,7 @@ int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)

nlh.nlmsg_len = NLMSG_LENGTH(len);
nlh.nlmsg_type = type;
nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST;
nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
nlh.nlmsg_pid = 0;
nlh.nlmsg_seq = rth->dump = ++rth->seq;

Expand Down
19 changes: 19 additions & 0 deletions lib/utils.c
Expand Up @@ -25,6 +25,7 @@
#include <linux/pkt_sched.h>
#include <time.h>
#include <sys/time.h>
#include <errno.h>


#include "utils.h"
Expand Down Expand Up @@ -198,6 +199,24 @@ int get_u8(__u8 *val, const char *arg, int base)
return 0;
}

int get_s32(__s32 *val, const char *arg, int base)
{
long res;
char *ptr;

errno = 0;

if (!arg || !*arg)
return -1;
res = strtol(arg, &ptr, base);
if (ptr == arg || *ptr ||
((res == LONG_MIN || res == LONG_MAX) && errno == ERANGE) ||
res > INT32_MAX || res < INT32_MIN)
return -1;
*val = res;
return 0;
}

int get_s16(__s16 *val, const char *arg, int base)
{
long res;
Expand Down
6 changes: 3 additions & 3 deletions man/man7/tc-hfsc.7
@@ -1,6 +1,6 @@
.TH HFSC 7 "31 October 2011" iproute2 Linux
.ce 1
\fBHIERARCHICAL FAIR SERVICE CURVE\fR
.TH "TC\-HFSC" 7 "31 October 2011" iproute2 Linux
.SH "NAME"
tc-hfcs \- Hierarchical Fair Service Curve
.
.SH "HISTORY & INTRODUCTION"
.
Expand Down
4 changes: 2 additions & 2 deletions man/man8/ip-address.8
@@ -1,6 +1,6 @@
.TH IP\-ADDRESS 8 "20 Dec 2011" "iproute2" "Linux"
.TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip address \- protocol address management
ip-address \- protocol address management
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-addrlabel.8
@@ -1,6 +1,6 @@
.TH IP\-ADDRLABEL 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip addrlabel \- protocol address label management
ip-addrlabel \- protocol address label management
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-link.8
@@ -1,6 +1,6 @@
.TH IP\-LINK 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip link \- network device configuration
ip-link \- network device configuration
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-maddress.8
@@ -1,6 +1,6 @@
.TH IP\-MADDRESS 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip maddress \- multicast addresses management
ip-maddress \- multicast addresses management
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-monitor.8
@@ -1,6 +1,6 @@
.TH IP\-MONITOR 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip monitor and rtmon \- state monitoring
ip-monitor and rtmon \- state monitoring
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-mroute.8
@@ -1,6 +1,6 @@
.TH IP\-MROUTE 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip mroute \- multicast routing cache management
ip-mroute \- multicast routing cache management
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-neighbour.8
@@ -1,6 +1,6 @@
.TH IP\-NEIGHBOUR 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip neighbour \- neighbour/arp tables management.
ip-neighbour \- neighbour/arp tables management.
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-netns.8
@@ -1,6 +1,6 @@
.TH IP\-NETNS 8 "20 Dec 2011" "iproute2" "Linux"
.SH NAME
ip netns \- process network namespace management
ip-netns \- process network namespace management
.SH SYNOPSIS
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-ntable.8
@@ -1,6 +1,6 @@
.TH IP\-NTABLE 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip ntable - neighbour table configuration
ip-ntable - neighbour table configuration
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-route.8
@@ -1,6 +1,6 @@
.TH IP\-ROUTE 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip route \- routing table management
ip-route \- routing table management
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-rule.8
@@ -1,6 +1,6 @@
.TH IP\-RULE 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip rule \- routing policy database management
ip-rule \- routing policy database management
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-tunnel.8
@@ -1,6 +1,6 @@
.TH IP\-TUNNEL 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip tunnel - tunnel configuration
ip-tunnel - tunnel configuration
.SH "SYNOPSIS"
.sp
.ad l
Expand Down
2 changes: 1 addition & 1 deletion man/man8/ip-xfrm.8
@@ -1,6 +1,6 @@
.TH IP\-XFRM 8 "20 Dec 2011" "iproute2" "Linux"
.SH "NAME"
ip xfrm \- transform configuration
ip-xfrm \- transform configuration
.SH "SYNOPSIS"
.sp
.ad l
Expand Down

0 comments on commit 5662ed6

Please sign in to comment.