mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (183 commits)
[TG3]: Update version to 3.78.
[TG3]: Add missing NVRAM strapping.
[TG3]: Enable auto MDI.
[TG3]: Fix the polarity bit.
[TG3]: Fix irq_sync race condition.
[NET_SCHED]: ematch: module autoloading
[TCP]: tcp probe wraparound handling and other changes
[RTNETLINK]: rtnl_link: allow specifying initial device address
[RTNETLINK]: rtnl_link API simplification
[VLAN]: Fix MAC address handling
[ETH]: Validate address in eth_mac_addr
[NET]: Fix races in net_rx_action vs netpoll.
[AF_UNIX]: Rewrite garbage collector, fixes race.
[NETFILTER]: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference (CVE-2007-2876)
[NET]: Make all initialized struct seq_operations const.
[UDP]: Fix length check.
[IPV6]: Remove unneeded pointer idev from addrconf_cleanup().
[DECNET]: Another unnecessary net/tcp.h inclusion in net/dn.h
[IPV6]: Make IPV6_{RECV,2292}RTHDR boolean options.
[IPV6]: Do not send RH0 anymore.
...
Fixed up trivial conflict in Documentation/feature-removal-schedule.txt
manually.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -91,7 +91,6 @@ header-y += in6.h
|
||||
header-y += in_route.h
|
||||
header-y += ioctl.h
|
||||
header-y += ipmi_msgdefs.h
|
||||
header-y += ip_mp_alg.h
|
||||
header-y += ipsec.h
|
||||
header-y += ipx.h
|
||||
header-y += irda.h
|
||||
@@ -226,6 +225,7 @@ unifdef-y += if_fddi.h
|
||||
unifdef-y += if_frad.h
|
||||
unifdef-y += if_ltalk.h
|
||||
unifdef-y += if_link.h
|
||||
unifdef-y += if_pppol2tp.h
|
||||
unifdef-y += if_pppox.h
|
||||
unifdef-y += if_shaper.h
|
||||
unifdef-y += if_tr.h
|
||||
|
||||
@@ -39,13 +39,8 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev
|
||||
extern int eth_header_cache(struct neighbour *neigh,
|
||||
struct hh_cache *hh);
|
||||
|
||||
extern struct net_device *alloc_etherdev(int sizeof_priv);
|
||||
static inline void eth_copy_and_sum (struct sk_buff *dest,
|
||||
const unsigned char *src,
|
||||
int len, int base)
|
||||
{
|
||||
memcpy (dest->data, src, len);
|
||||
}
|
||||
extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count);
|
||||
#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
|
||||
|
||||
/**
|
||||
* is_zero_ether_addr - Determine if give Ethernet address is all zeros.
|
||||
|
||||
@@ -76,6 +76,8 @@ enum
|
||||
#define IFLA_WEIGHT IFLA_WEIGHT
|
||||
IFLA_OPERSTATE,
|
||||
IFLA_LINKMODE,
|
||||
IFLA_LINKINFO,
|
||||
#define IFLA_LINKINFO IFLA_LINKINFO
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
@@ -140,4 +142,49 @@ struct ifla_cacheinfo
|
||||
__u32 retrans_time;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
IFLA_INFO_UNSPEC,
|
||||
IFLA_INFO_KIND,
|
||||
IFLA_INFO_DATA,
|
||||
IFLA_INFO_XSTATS,
|
||||
__IFLA_INFO_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
|
||||
|
||||
/* VLAN section */
|
||||
|
||||
enum
|
||||
{
|
||||
IFLA_VLAN_UNSPEC,
|
||||
IFLA_VLAN_ID,
|
||||
IFLA_VLAN_FLAGS,
|
||||
IFLA_VLAN_EGRESS_QOS,
|
||||
IFLA_VLAN_INGRESS_QOS,
|
||||
__IFLA_VLAN_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
|
||||
|
||||
struct ifla_vlan_flags {
|
||||
__u32 flags;
|
||||
__u32 mask;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
IFLA_VLAN_QOS_UNSPEC,
|
||||
IFLA_VLAN_QOS_MAPPING,
|
||||
__IFLA_VLAN_QOS_MAX
|
||||
};
|
||||
|
||||
#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
|
||||
|
||||
struct ifla_vlan_qos_mapping
|
||||
{
|
||||
__u32 from;
|
||||
__u32 to;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_IF_LINK_H */
|
||||
|
||||
@@ -110,6 +110,21 @@ struct ifpppcstatsreq {
|
||||
struct ppp_comp_stats stats;
|
||||
};
|
||||
|
||||
/* For PPPIOCGL2TPSTATS */
|
||||
struct pppol2tp_ioc_stats {
|
||||
__u16 tunnel_id; /* redundant */
|
||||
__u16 session_id; /* if zero, get tunnel stats */
|
||||
__u32 using_ipsec:1; /* valid only for session_id == 0 */
|
||||
aligned_u64 tx_packets;
|
||||
aligned_u64 tx_bytes;
|
||||
aligned_u64 tx_errors;
|
||||
aligned_u64 rx_packets;
|
||||
aligned_u64 rx_bytes;
|
||||
aligned_u64 rx_seq_discards;
|
||||
aligned_u64 rx_oos_packets;
|
||||
aligned_u64 rx_errors;
|
||||
};
|
||||
|
||||
#define ifr__name b.ifr_ifrn.ifrn_name
|
||||
#define stats_ptr b.ifr_ifru.ifru_data
|
||||
|
||||
@@ -146,6 +161,7 @@ struct ifpppcstatsreq {
|
||||
#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
|
||||
#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
|
||||
#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
|
||||
#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
|
||||
|
||||
#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
|
||||
#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
|
||||
|
||||
69
include/linux/if_pppol2tp.h
Normal file
69
include/linux/if_pppol2tp.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/***************************************************************************
|
||||
* Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
|
||||
*
|
||||
* This file supplies definitions required by the PPP over L2TP driver
|
||||
* (pppol2tp.c). All version information wrt this file is located in pppol2tp.c
|
||||
*
|
||||
* License:
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IF_PPPOL2TP_H
|
||||
#define __LINUX_IF_PPPOL2TP_H
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/in.h>
|
||||
#endif
|
||||
|
||||
/* Structure used to connect() the socket to a particular tunnel UDP
|
||||
* socket.
|
||||
*/
|
||||
struct pppol2tp_addr
|
||||
{
|
||||
pid_t pid; /* pid that owns the fd.
|
||||
* 0 => current */
|
||||
int fd; /* FD of UDP socket to use */
|
||||
|
||||
struct sockaddr_in addr; /* IP address and port to send to */
|
||||
|
||||
__be16 s_tunnel, s_session; /* For matching incoming packets */
|
||||
__be16 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
};
|
||||
|
||||
/* Socket options:
|
||||
* DEBUG - bitmask of debug message categories
|
||||
* SENDSEQ - 0 => don't send packets with sequence numbers
|
||||
* 1 => send packets with sequence numbers
|
||||
* RECVSEQ - 0 => receive packet sequence numbers are optional
|
||||
* 1 => drop receive packets without sequence numbers
|
||||
* LNSMODE - 0 => act as LAC.
|
||||
* 1 => act as LNS.
|
||||
* REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
|
||||
*/
|
||||
enum {
|
||||
PPPOL2TP_SO_DEBUG = 1,
|
||||
PPPOL2TP_SO_RECVSEQ = 2,
|
||||
PPPOL2TP_SO_SENDSEQ = 3,
|
||||
PPPOL2TP_SO_LNSMODE = 4,
|
||||
PPPOL2TP_SO_REORDERTO = 5,
|
||||
};
|
||||
|
||||
/* Debug message categories for the DEBUG socket option */
|
||||
enum {
|
||||
PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
|
||||
* compiled in) */
|
||||
PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
|
||||
* interface */
|
||||
PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
|
||||
PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <asm/semaphore.h>
|
||||
#include <linux/ppp_channel.h>
|
||||
#endif /* __KERNEL__ */
|
||||
#include <linux/if_pppol2tp.h>
|
||||
|
||||
/* For user-space programs to pick up these definitions
|
||||
* which they wouldn't get otherwise without defining __KERNEL__
|
||||
@@ -50,8 +51,9 @@ struct pppoe_addr{
|
||||
* Protocols supported by AF_PPPOX
|
||||
*/
|
||||
#define PX_PROTO_OE 0 /* Currently just PPPoE */
|
||||
#define PX_MAX_PROTO 1
|
||||
|
||||
#define PX_PROTO_OL2TP 1 /* Now L2TP also */
|
||||
#define PX_MAX_PROTO 2
|
||||
|
||||
struct sockaddr_pppox {
|
||||
sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
@@ -60,6 +62,16 @@ struct sockaddr_pppox {
|
||||
}sa_addr;
|
||||
}__attribute__ ((packed));
|
||||
|
||||
/* The use of the above union isn't viable because the size of this
|
||||
* struct must stay fixed over time -- applications use sizeof(struct
|
||||
* sockaddr_pppox) to fill it. We use a protocol specific sockaddr
|
||||
* type instead.
|
||||
*/
|
||||
struct sockaddr_pppol2tp {
|
||||
sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
struct pppol2tp_addr pppol2tp;
|
||||
}__attribute__ ((packed));
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
|
||||
@@ -36,6 +36,7 @@ struct tun_struct {
|
||||
unsigned long flags;
|
||||
int attached;
|
||||
uid_t owner;
|
||||
gid_t group;
|
||||
|
||||
wait_queue_head_t read_wait;
|
||||
struct sk_buff_head readq;
|
||||
@@ -78,6 +79,7 @@ struct tun_struct {
|
||||
#define TUNSETPERSIST _IOW('T', 203, int)
|
||||
#define TUNSETOWNER _IOW('T', 204, int)
|
||||
#define TUNSETLINK _IOW('T', 205, int)
|
||||
#define TUNSETGROUP _IOW('T', 206, int)
|
||||
|
||||
/* TUNSETIFF ifr flags */
|
||||
#define IFF_TUN 0x0001
|
||||
|
||||
@@ -99,7 +99,7 @@ static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id,
|
||||
}
|
||||
|
||||
struct vlan_priority_tci_mapping {
|
||||
unsigned long priority;
|
||||
u32 priority;
|
||||
unsigned short vlan_qos; /* This should be shifted when first set, so we only do it
|
||||
* at provisioning time.
|
||||
* ((skb->priority << 13) & 0xE000)
|
||||
@@ -112,7 +112,10 @@ struct vlan_dev_info {
|
||||
/** This will be the mapping that correlates skb->priority to
|
||||
* 3 bits of VLAN QOS tags...
|
||||
*/
|
||||
unsigned long ingress_priority_map[8];
|
||||
unsigned int nr_ingress_mappings;
|
||||
u32 ingress_priority_map[8];
|
||||
|
||||
unsigned int nr_egress_mappings;
|
||||
struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */
|
||||
|
||||
unsigned short vlan_id; /* The VLAN Identifier for this interface. */
|
||||
@@ -132,6 +135,7 @@ struct vlan_dev_info {
|
||||
int old_allmulti; /* similar to above. */
|
||||
int old_promiscuity; /* similar to above. */
|
||||
struct net_device *real_dev; /* the underlying device/interface */
|
||||
unsigned char real_dev_addr[ETH_ALEN];
|
||||
struct proc_dir_entry *dent; /* Holds the proc data */
|
||||
unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */
|
||||
unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */
|
||||
@@ -395,6 +399,10 @@ enum vlan_ioctl_cmds {
|
||||
GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
|
||||
};
|
||||
|
||||
enum vlan_flags {
|
||||
VLAN_FLAG_REORDER_HDR = 0x1,
|
||||
};
|
||||
|
||||
enum vlan_name_types {
|
||||
VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
|
||||
VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/* ip_mp_alg.h: IPV4 multipath algorithm support, user-visible values.
|
||||
*
|
||||
* Copyright (C) 2004, 2005 Einar Lueck <elueck@de.ibm.com>
|
||||
* Copyright (C) 2005 David S. Miller <davem@davemloft.net>
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IP_MP_ALG_H
|
||||
#define _LINUX_IP_MP_ALG_H
|
||||
|
||||
enum ip_mp_alg {
|
||||
IP_MP_ALG_NONE,
|
||||
IP_MP_ALG_RR,
|
||||
IP_MP_ALG_DRR,
|
||||
IP_MP_ALG_RANDOM,
|
||||
IP_MP_ALG_WRANDOM,
|
||||
__IP_MP_ALG_MAX
|
||||
};
|
||||
|
||||
#define IP_MP_ALG_MAX (__IP_MP_ALG_MAX - 1)
|
||||
|
||||
#endif /* _LINUX_IP_MP_ALG_H */
|
||||
|
||||
@@ -27,8 +27,8 @@ struct in6_ifreq {
|
||||
int ifr6_ifindex;
|
||||
};
|
||||
|
||||
#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
|
||||
#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
|
||||
#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
|
||||
#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
|
||||
#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
|
||||
|
||||
/*
|
||||
@@ -247,7 +247,7 @@ struct inet6_skb_parm {
|
||||
__u16 lastopt;
|
||||
__u32 nhoff;
|
||||
__u16 flags;
|
||||
#ifdef CONFIG_IPV6_MIP6
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
__u16 dsthao;
|
||||
#endif
|
||||
|
||||
@@ -299,8 +299,8 @@ struct ipv6_pinfo {
|
||||
/* pktoption flags */
|
||||
union {
|
||||
struct {
|
||||
__u16 srcrt:2,
|
||||
osrcrt:2,
|
||||
__u16 srcrt:1,
|
||||
osrcrt:1,
|
||||
rxinfo:1,
|
||||
rxoinfo:1,
|
||||
rxhlim:1,
|
||||
|
||||
@@ -216,6 +216,34 @@ struct if_irda_req {
|
||||
#define ifr_dtr ifr_ifru.ifru_line.dtr
|
||||
#define ifr_rts ifr_ifru.ifru_line.rts
|
||||
|
||||
|
||||
/* IrDA netlink definitions */
|
||||
#define IRDA_NL_NAME "irda"
|
||||
#define IRDA_NL_VERSION 1
|
||||
|
||||
enum irda_nl_commands {
|
||||
IRDA_NL_CMD_UNSPEC,
|
||||
IRDA_NL_CMD_SET_MODE,
|
||||
IRDA_NL_CMD_GET_MODE,
|
||||
|
||||
__IRDA_NL_CMD_AFTER_LAST
|
||||
};
|
||||
#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
|
||||
|
||||
enum nl80211_attrs {
|
||||
IRDA_NL_ATTR_UNSPEC,
|
||||
IRDA_NL_ATTR_IFNAME,
|
||||
IRDA_NL_ATTR_MODE,
|
||||
|
||||
__IRDA_NL_ATTR_AFTER_LAST
|
||||
};
|
||||
#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
|
||||
|
||||
/* IrDA modes */
|
||||
#define IRDA_MODE_PRIMARY 0x1
|
||||
#define IRDA_MODE_SECONDARY 0x2
|
||||
#define IRDA_MODE_MONITOR 0x4
|
||||
|
||||
#endif /* KERNEL_IRDA_H */
|
||||
|
||||
|
||||
|
||||
@@ -279,6 +279,16 @@ static inline s64 ktime_to_us(const ktime_t kt)
|
||||
return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
|
||||
}
|
||||
|
||||
static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
|
||||
{
|
||||
return ktime_to_us(ktime_sub(later, earlier));
|
||||
}
|
||||
|
||||
static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
|
||||
{
|
||||
return ktime_add_ns(kt, usec * 1000);
|
||||
}
|
||||
|
||||
/*
|
||||
* The resolution of the clocks. The resolution value is returned in
|
||||
* the clock_getres() system call to give application programmers an
|
||||
|
||||
@@ -108,6 +108,14 @@ struct wireless_dev;
|
||||
#define MAX_HEADER (LL_MAX_HEADER + 48)
|
||||
#endif
|
||||
|
||||
struct net_device_subqueue
|
||||
{
|
||||
/* Give a control state for each queue. This struct may contain
|
||||
* per-queue locks in the future.
|
||||
*/
|
||||
unsigned long state;
|
||||
};
|
||||
|
||||
/*
|
||||
* Network device statistics. Akin to the 2.0 ether stats but
|
||||
* with byte counters.
|
||||
@@ -177,19 +185,24 @@ struct netif_rx_stats
|
||||
|
||||
DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
|
||||
|
||||
struct dev_addr_list
|
||||
{
|
||||
struct dev_addr_list *next;
|
||||
u8 da_addr[MAX_ADDR_LEN];
|
||||
u8 da_addrlen;
|
||||
int da_users;
|
||||
int da_gusers;
|
||||
};
|
||||
|
||||
/*
|
||||
* We tag multicasts with these structures.
|
||||
*/
|
||||
|
||||
struct dev_mc_list
|
||||
{
|
||||
struct dev_mc_list *next;
|
||||
__u8 dmi_addr[MAX_ADDR_LEN];
|
||||
unsigned char dmi_addrlen;
|
||||
int dmi_users;
|
||||
int dmi_gusers;
|
||||
};
|
||||
|
||||
#define dev_mc_list dev_addr_list
|
||||
#define dmi_addr da_addr
|
||||
#define dmi_addrlen da_addrlen
|
||||
#define dmi_users da_users
|
||||
#define dmi_gusers da_gusers
|
||||
|
||||
struct hh_cache
|
||||
{
|
||||
@@ -248,6 +261,8 @@ enum netdev_state_t
|
||||
__LINK_STATE_LINKWATCH_PENDING,
|
||||
__LINK_STATE_DORMANT,
|
||||
__LINK_STATE_QDISC_RUNNING,
|
||||
/* Set by the netpoll NAPI code */
|
||||
__LINK_STATE_POLL_LIST_FROZEN,
|
||||
};
|
||||
|
||||
|
||||
@@ -314,9 +329,10 @@ struct net_device
|
||||
/* Net device features */
|
||||
unsigned long features;
|
||||
#define NETIF_F_SG 1 /* Scatter/gather IO. */
|
||||
#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */
|
||||
#define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */
|
||||
#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
|
||||
#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
|
||||
#define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */
|
||||
#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
|
||||
#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
|
||||
#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
|
||||
@@ -325,6 +341,7 @@ struct net_device
|
||||
#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
|
||||
#define NETIF_F_GSO 2048 /* Enable software GSO. */
|
||||
#define NETIF_F_LLTX 4096 /* LockLess TX */
|
||||
#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */
|
||||
|
||||
/* Segmentation offload features */
|
||||
#define NETIF_F_GSO_SHIFT 16
|
||||
@@ -338,8 +355,11 @@ struct net_device
|
||||
/* List of features with software fallbacks. */
|
||||
#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
|
||||
|
||||
|
||||
#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
|
||||
#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
|
||||
#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
|
||||
#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
|
||||
#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
|
||||
|
||||
struct net_device *next_sched;
|
||||
|
||||
@@ -388,7 +408,10 @@ struct net_device
|
||||
unsigned char addr_len; /* hardware address length */
|
||||
unsigned short dev_id; /* for shared network cards */
|
||||
|
||||
struct dev_mc_list *mc_list; /* Multicast mac addresses */
|
||||
struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */
|
||||
int uc_count; /* Number of installed ucasts */
|
||||
int uc_promisc;
|
||||
struct dev_addr_list *mc_list; /* Multicast mac addresses */
|
||||
int mc_count; /* Number of installed mcasts */
|
||||
int promiscuity;
|
||||
int allmulti;
|
||||
@@ -493,6 +516,8 @@ struct net_device
|
||||
void *saddr,
|
||||
unsigned len);
|
||||
int (*rebuild_header)(struct sk_buff *skb);
|
||||
#define HAVE_SET_RX_MODE
|
||||
void (*set_rx_mode)(struct net_device *dev);
|
||||
#define HAVE_MULTICAST
|
||||
void (*set_multicast_list)(struct net_device *dev);
|
||||
#define HAVE_SET_MAC_ADDR
|
||||
@@ -540,17 +565,22 @@ struct net_device
|
||||
struct device dev;
|
||||
/* space for optional statistics and wireless sysfs groups */
|
||||
struct attribute_group *sysfs_groups[3];
|
||||
|
||||
/* rtnetlink link ops */
|
||||
const struct rtnl_link_ops *rtnl_link_ops;
|
||||
|
||||
/* The TX queue control structures */
|
||||
unsigned int egress_subqueue_count;
|
||||
struct net_device_subqueue egress_subqueue[0];
|
||||
};
|
||||
#define to_net_dev(d) container_of(d, struct net_device, dev)
|
||||
|
||||
#define NETDEV_ALIGN 32
|
||||
#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
|
||||
|
||||
static inline void *netdev_priv(struct net_device *dev)
|
||||
static inline void *netdev_priv(const struct net_device *dev)
|
||||
{
|
||||
return (char *)dev + ((sizeof(struct net_device)
|
||||
+ NETDEV_ALIGN_CONST)
|
||||
& ~NETDEV_ALIGN_CONST);
|
||||
return dev->priv;
|
||||
}
|
||||
|
||||
#define SET_MODULE_OWNER(dev) do { } while (0)
|
||||
@@ -702,6 +732,62 @@ static inline int netif_running(const struct net_device *dev)
|
||||
return test_bit(__LINK_STATE_START, &dev->state);
|
||||
}
|
||||
|
||||
/*
|
||||
* Routines to manage the subqueues on a device. We only need start
|
||||
* stop, and a check if it's stopped. All other device management is
|
||||
* done at the overall netdevice level.
|
||||
* Also test the device if we're multiqueue.
|
||||
*/
|
||||
static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
|
||||
{
|
||||
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
|
||||
clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
|
||||
{
|
||||
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
|
||||
#ifdef CONFIG_NETPOLL_TRAP
|
||||
if (netpoll_trap())
|
||||
return;
|
||||
#endif
|
||||
set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int netif_subqueue_stopped(const struct net_device *dev,
|
||||
u16 queue_index)
|
||||
{
|
||||
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
|
||||
return test_bit(__LINK_STATE_XOFF,
|
||||
&dev->egress_subqueue[queue_index].state);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
|
||||
{
|
||||
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
|
||||
#ifdef CONFIG_NETPOLL_TRAP
|
||||
if (netpoll_trap())
|
||||
return;
|
||||
#endif
|
||||
if (test_and_clear_bit(__LINK_STATE_XOFF,
|
||||
&dev->egress_subqueue[queue_index].state))
|
||||
__netif_schedule(dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int netif_is_multiqueue(const struct net_device *dev)
|
||||
{
|
||||
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
|
||||
return (!!(NETIF_F_MULTI_QUEUE & dev->features));
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Use this variant when it is known for sure that it
|
||||
* is executing from interrupt context.
|
||||
@@ -930,6 +1016,14 @@ static inline void netif_rx_complete(struct net_device *dev)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
#ifdef CONFIG_NETPOLL
|
||||
/* Prevent race with netpoll - yes, this is a kludge.
|
||||
* But at least it doesn't penalize the non-netpoll
|
||||
* code path. */
|
||||
if (test_bit(__LINK_STATE_POLL_LIST_FROZEN, &dev->state))
|
||||
return;
|
||||
#endif
|
||||
|
||||
local_irq_save(flags);
|
||||
__netif_rx_complete(dev);
|
||||
local_irq_restore(flags);
|
||||
@@ -992,15 +1086,24 @@ static inline void netif_tx_disable(struct net_device *dev)
|
||||
extern void ether_setup(struct net_device *dev);
|
||||
|
||||
/* Support for loadable net-drivers */
|
||||
extern struct net_device *alloc_netdev(int sizeof_priv, const char *name,
|
||||
void (*setup)(struct net_device *));
|
||||
extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
|
||||
void (*setup)(struct net_device *),
|
||||
unsigned int queue_count);
|
||||
#define alloc_netdev(sizeof_priv, name, setup) \
|
||||
alloc_netdev_mq(sizeof_priv, name, setup, 1)
|
||||
extern int register_netdev(struct net_device *dev);
|
||||
extern void unregister_netdev(struct net_device *dev);
|
||||
/* Functions used for multicast support */
|
||||
extern void dev_mc_upload(struct net_device *dev);
|
||||
/* Functions used for secondary unicast and multicast support */
|
||||
extern void dev_set_rx_mode(struct net_device *dev);
|
||||
extern void __dev_set_rx_mode(struct net_device *dev);
|
||||
extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen);
|
||||
extern int dev_unicast_add(struct net_device *dev, void *addr, int alen);
|
||||
extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
|
||||
extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
|
||||
extern void dev_mc_discard(struct net_device *dev);
|
||||
extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
|
||||
extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
|
||||
extern void __dev_addr_discard(struct dev_addr_list **list);
|
||||
extern void dev_set_promiscuity(struct net_device *dev, int inc);
|
||||
extern void dev_set_allmulti(struct net_device *dev, int inc);
|
||||
extern void netdev_state_change(struct net_device *dev);
|
||||
|
||||
@@ -275,7 +275,8 @@ struct nf_queue_handler {
|
||||
};
|
||||
extern int nf_register_queue_handler(int pf,
|
||||
struct nf_queue_handler *qh);
|
||||
extern int nf_unregister_queue_handler(int pf);
|
||||
extern int nf_unregister_queue_handler(int pf,
|
||||
struct nf_queue_handler *qh);
|
||||
extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh);
|
||||
extern void nf_reinject(struct sk_buff *skb,
|
||||
struct nf_info *info,
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <linux/netfilter/nf_conntrack_common.h>
|
||||
|
||||
extern const char *pptp_msg_name[];
|
||||
|
||||
/* state of the control session */
|
||||
enum pptp_ctrlsess_state {
|
||||
PPTP_SESSION_NONE, /* no session present */
|
||||
|
||||
@@ -141,22 +141,22 @@ struct xt_match
|
||||
/* Arguments changed since 2.6.9, as this must now handle
|
||||
non-linear skb, using skb_header_pointer and
|
||||
skb_ip_make_writable. */
|
||||
int (*match)(const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const struct xt_match *match,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
unsigned int protoff,
|
||||
int *hotdrop);
|
||||
bool (*match)(const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const struct xt_match *match,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
unsigned int protoff,
|
||||
bool *hotdrop);
|
||||
|
||||
/* Called when user tries to insert an entry of this type. */
|
||||
/* Should return true or false. */
|
||||
int (*checkentry)(const char *tablename,
|
||||
const void *ip,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int hook_mask);
|
||||
bool (*checkentry)(const char *tablename,
|
||||
const void *ip,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int hook_mask);
|
||||
|
||||
/* Called when entry of this type deleted. */
|
||||
void (*destroy)(const struct xt_match *match, void *matchinfo);
|
||||
@@ -202,11 +202,11 @@ struct xt_target
|
||||
hook_mask is a bitmask of hooks from which it can be
|
||||
called. */
|
||||
/* Should return true or false. */
|
||||
int (*checkentry)(const char *tablename,
|
||||
const void *entry,
|
||||
const struct xt_target *target,
|
||||
void *targinfo,
|
||||
unsigned int hook_mask);
|
||||
bool (*checkentry)(const char *tablename,
|
||||
const void *entry,
|
||||
const struct xt_target *target,
|
||||
void *targinfo,
|
||||
unsigned int hook_mask);
|
||||
|
||||
/* Called when entry of this type deleted. */
|
||||
void (*destroy)(const struct xt_target *target, void *targinfo);
|
||||
|
||||
40
include/linux/netfilter/xt_u32.h
Normal file
40
include/linux/netfilter/xt_u32.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _XT_U32_H
|
||||
#define _XT_U32_H 1
|
||||
|
||||
enum xt_u32_ops {
|
||||
XT_U32_AND,
|
||||
XT_U32_LEFTSH,
|
||||
XT_U32_RIGHTSH,
|
||||
XT_U32_AT,
|
||||
};
|
||||
|
||||
struct xt_u32_location_element {
|
||||
u_int32_t number;
|
||||
u_int8_t nextop;
|
||||
};
|
||||
|
||||
struct xt_u32_value_element {
|
||||
u_int32_t min;
|
||||
u_int32_t max;
|
||||
};
|
||||
|
||||
/*
|
||||
* Any way to allow for an arbitrary number of elements?
|
||||
* For now, I settle with a limit of 10 each.
|
||||
*/
|
||||
#define XT_U32_MAXSIZE 10
|
||||
|
||||
struct xt_u32_test {
|
||||
struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
|
||||
struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
|
||||
u_int8_t nnums;
|
||||
u_int8_t nvalues;
|
||||
};
|
||||
|
||||
struct xt_u32 {
|
||||
struct xt_u32_test tests[XT_U32_MAXSIZE+1];
|
||||
u_int8_t ntests;
|
||||
u_int8_t invert;
|
||||
};
|
||||
|
||||
#endif /* _XT_U32_H */
|
||||
@@ -18,13 +18,13 @@ struct clusterip_config;
|
||||
struct ipt_clusterip_tgt_info {
|
||||
|
||||
u_int32_t flags;
|
||||
|
||||
|
||||
/* only relevant for new ones */
|
||||
u_int8_t clustermac[6];
|
||||
u_int16_t num_total_nodes;
|
||||
u_int16_t num_local_nodes;
|
||||
u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
|
||||
enum clusterip_hashmode hash_mode;
|
||||
u_int32_t hash_mode;
|
||||
u_int32_t hash_initval;
|
||||
|
||||
struct clusterip_config *config;
|
||||
|
||||
@@ -44,8 +44,14 @@ struct ip6t_ip6 {
|
||||
char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
|
||||
unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
|
||||
|
||||
/* ARGH, HopByHop uses 0, so can't do 0 = ANY,
|
||||
instead IP6T_F_NOPROTO must be set */
|
||||
/* Upper protocol number
|
||||
* - The allowed value is 0 (any) or protocol number of last parsable
|
||||
* header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
|
||||
* the non IPv6 extension headers.
|
||||
* - The protocol numbers of IPv6 extension headers except of ESP and
|
||||
* MH do not match any packets.
|
||||
* - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
|
||||
*/
|
||||
u_int16_t proto;
|
||||
/* TOS to match iff flags & IP6T_F_TOS */
|
||||
u_int8_t tos;
|
||||
|
||||
@@ -403,16 +403,13 @@ enum
|
||||
* 1..32767 Reserved for ematches inside kernel tree
|
||||
* 32768..65535 Free to use, not reliable
|
||||
*/
|
||||
enum
|
||||
{
|
||||
TCF_EM_CONTAINER,
|
||||
TCF_EM_CMP,
|
||||
TCF_EM_NBYTE,
|
||||
TCF_EM_U32,
|
||||
TCF_EM_META,
|
||||
TCF_EM_TEXT,
|
||||
__TCF_EM_MAX
|
||||
};
|
||||
#define TCF_EM_CONTAINER 0
|
||||
#define TCF_EM_CMP 1
|
||||
#define TCF_EM_NBYTE 2
|
||||
#define TCF_EM_U32 3
|
||||
#define TCF_EM_META 4
|
||||
#define TCF_EM_TEXT 5
|
||||
#define TCF_EM_MAX 5
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user