-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: Move fou_build_header into fou.c and refactor
Move fou_build_header out of ip_tunnel.c and into fou.c splitting it up into fou_build_header, gue_build_header, and fou_build_udp. This allows for other users for TX of FOU or GUE. Change ip_tunnel_encap to call fou_build_header or gue_build_header based on the tunnel encapsulation type. Similarly, added fou_encap_hlen and gue_encap_hlen functions which are called by ip_encap_hlen. New net/fou.h has prototypes and defines for this. Added NET_FOU_IP_TUNNELS configuration. When this is set, IP tunnels can use FOU/GUE and fou module is also selected. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Tom Herbert
authored and
David S. Miller
committed
Nov 5, 2014
1 parent
890b791
commit 63487ba
Showing
4 changed files
with
120 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef __NET_FOU_H | ||
#define __NET_FOU_H | ||
|
||
#include <linux/skbuff.h> | ||
|
||
#include <net/flow.h> | ||
#include <net/gue.h> | ||
#include <net/ip_tunnels.h> | ||
#include <net/udp.h> | ||
|
||
int fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e, | ||
u8 *protocol, struct flowi4 *fl4); | ||
int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e, | ||
u8 *protocol, struct flowi4 *fl4); | ||
|
||
static size_t fou_encap_hlen(struct ip_tunnel_encap *e) | ||
{ | ||
return sizeof(struct udphdr); | ||
} | ||
|
||
static size_t gue_encap_hlen(struct ip_tunnel_encap *e) | ||
{ | ||
return sizeof(struct udphdr) + sizeof(struct guehdr); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters