Skip to content

Commit

Permalink
esp4: Reorganize esp_output
Browse files Browse the repository at this point in the history
We need a fallback for ESP at layer 2, so split esp_output
into generic functions that can be used at layer 3 and layer 2
and use them in esp_output. We also add esp_xmit which is
used for the layer 2 fallback.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
klassert committed Apr 14, 2017
1 parent f1fbed0 commit fca11eb
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 158 deletions.
16 changes: 16 additions & 0 deletions include/net/esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
return (struct ip_esp_hdr *)skb_transport_header(skb);
}

struct esp_info {
struct ip_esp_hdr *esph;
__be64 seqno;
int tfclen;
int tailen;
int plen;
int clen;
int len;
int nfrags;
__u8 proto;
bool inplace;
};

int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
int esp_input_done2(struct sk_buff *skb, int err);
#endif
Loading

0 comments on commit fca11eb

Please sign in to comment.