| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef _NET_OVPN_DCO_OVPNADDR_H_ |
| 11 |
#define _NET_OVPN_DCO_OVPNADDR_H_ |
| 12 |
|
| 13 |
#include "crypto.h" |
| 14 |
|
| 15 |
#include <linux/jhash.h> |
| 16 |
#include <linux/in.h> |
| 17 |
#include <linux/in6.h> |
| 18 |
#include <net/ipv6.h> |
| 19 |
|
| 20 |
|
| 21 |
struct ovpn_sockaddr { |
| 22 |
union { |
| 23 |
struct sockaddr_in in4; |
| 24 |
struct sockaddr_in6 in6; |
| 25 |
}; |
| 26 |
}; |
| 27 |
|
| 28 |
|
| 29 |
static inline unsigned short skb_protocol_to_family(const struct sk_buff *skb) |
| 30 |
{ |
| 31 |
switch (skb->protocol) { |
| 32 |
case htons(ETH_P_IP): |
| 33 |
return AF_INET; |
| 34 |
case htons(ETH_P_IPV6): |
| 35 |
return AF_INET6; |
| 36 |
default: |
| 37 |
return 0; |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
#endif |