diff options
| author | David S. Miller <davem@nuts.davemloft.net> | 2004-04-15 20:37:13 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2004-04-15 20:37:13 -0700 |
| commit | 2160211c3a9f0f6f3b9a0a5998b74ee9be30ce3e (patch) | |
| tree | dab450c9cb007ee7fbde8024bd0ecc2b83be8e0a /include/linux | |
| parent | 583953a5146bc419c630089ae9f17c178e0a1eb1 (diff) | |
| parent | 6264f96f9e15f7c4c6a1377e957d7c0f9174330f (diff) | |
Merge.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/atmdev.h | 4 | ||||
| -rw-r--r-- | include/linux/etherdevice.h | 20 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_tftp.h | 3 | ||||
| -rw-r--r-- | include/linux/netlink.h | 7 | ||||
| -rw-r--r-- | include/linux/rtnetlink.h | 9 | ||||
| -rw-r--r-- | include/linux/udp.h | 1 |
6 files changed, 38 insertions, 6 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 81f37e55c510..9242c9c3142e 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -399,9 +399,9 @@ void vcc_remove_socket(struct sock *sk); * */ -static inline int atm_guess_pdu2truesize(int pdu_size) +static inline int atm_guess_pdu2truesize(int size) { - return ((pdu_size+15) & ~15) + sizeof(struct sk_buff); + return (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info)); } diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 462f7234695f..6af5ecf9787a 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -25,6 +25,7 @@ #define _LINUX_ETHERDEVICE_H #include <linux/if_ether.h> +#include <linux/random.h> #ifdef __KERNEL__ extern int eth_header(struct sk_buff *skb, struct net_device *dev, @@ -40,7 +41,9 @@ extern int eth_header_parse(struct sk_buff *skb, unsigned char *haddr); extern struct net_device *alloc_etherdev(int sizeof_priv); -static inline void eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, int len, int base) +static inline void eth_copy_and_sum (struct sk_buff *dest, + const unsigned char *src, + int len, int base) { memcpy (dest->data, src, len); } @@ -55,13 +58,26 @@ static inline void eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, i * * Return true if the address is valid. */ -static inline int is_valid_ether_addr( u8 *addr ) +static inline int is_valid_ether_addr( const u8 *addr ) { const char zaddr[6] = {0,}; return !(addr[0]&1) && memcmp( addr, zaddr, 6); } +/** + * random_ether_addr - Generate software assigned random Ethernet address + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Generate a random Ethernet address (MAC) that is not multicast + * and has the local assigned bit set. + */ +static inline void random_ether_addr(u8 *addr) +{ + get_random_bytes (addr, ETH_ALEN); + addr [0] &= 0xfe; /* clear multicast bit */ + addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ +} #endif #endif /* _LINUX_ETHERDEVICE_H */ diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h index 7a68bafaac2d..8b75b45f1f61 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h @@ -9,5 +9,8 @@ struct tftphdr { #define TFTP_OPCODE_READ 1 #define TFTP_OPCODE_WRITE 2 +#define TFTP_OPCODE_DATA 3 +#define TFTP_OPCODE_ACK 4 +#define TFTP_OPCODE_ERROR 5 #endif /* _IP_CT_TFTP */ diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 5adca479de6e..0602eaffbad2 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -127,6 +127,13 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long t void netlink_detachskb(struct sock *sk, struct sk_buff *skb); int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); +/* finegrained unicast helpers: */ +struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid); +struct sock *netlink_getsockbyfilp(struct file *filp); +int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo); +void netlink_detachskb(struct sock *sk, struct sk_buff *skb); +int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); + /* * skb should fit one page. This choice is good for headerless malloc. * diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 6cfd6f2f4a98..fbf366ecd1c8 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -47,7 +47,11 @@ #define RTM_NEWPREFIX (RTM_BASE+36) #define RTM_GETPREFIX (RTM_BASE+38) -#define RTM_MAX (RTM_BASE+39) +#define RTM_GETMULTICAST (RTM_BASE+42) + +#define RTM_GETANYCAST (RTM_BASE+46) + +#define RTM_MAX (RTM_BASE+47) /* Generic structure for encapsulation of optional route information. @@ -340,7 +344,8 @@ enum IFA_LABEL, IFA_BROADCAST, IFA_ANYCAST, - IFA_CACHEINFO + IFA_CACHEINFO, + IFA_MULTICAST }; #define IFA_MAX IFA_CACHEINFO diff --git a/include/linux/udp.h b/include/linux/udp.h index cecbccdc1835..facf661dd65a 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -31,6 +31,7 @@ struct udphdr { #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ /* UDP encapsulation types */ +#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ #ifdef __KERNEL__ |
