X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Ftunnel.h;h=37874c57cf3d6cc9e6718a806c756573526dd339;hb=933df876ffa272d9d5768edf7fc5465261888ad2;hp=89e73bac67677ea46df8289cedb3b8e258767df5;hpb=d1eb60ccff0c2dbef2300cdfc5fead3c2d394beb;p=openvswitch diff --git a/datapath/tunnel.h b/datapath/tunnel.h index 89e73bac..37874c57 100644 --- a/datapath/tunnel.h +++ b/datapath/tunnel.h @@ -13,8 +13,10 @@ #include "table.h" #include "vport.h" -/* The absolute minimum fragment size. Note that there are many other - * definitions of the minimum MTU. */ +/* + * The absolute minimum fragment size. Note that there are many other + * definitions of the minimum MTU. + */ #define IP_MIN_MTU 68 /* @@ -23,6 +25,7 @@ * you have only the first 10 bits to define protocol identifiers. */ #define TNL_T_PROTO_GRE 0 +#define TNL_T_PROTO_CAPWAP 1 /* You only need these flags when you are calling tnl_find_port(). */ #define TNL_T_KEY_EXACT (1 << 10) @@ -47,9 +50,24 @@ struct tnl_ops { u32 tunnel_type; u8 ipproto; + /* + * Returns the length of the tunnel header you will add in + * build_header() (i.e. excludes the IP header). Returns a negative + * error code if the configuration is invalid. + */ int (*hdr_len)(const struct tnl_port_config *); - void (*build_header)(struct sk_buff *, const struct vport *, - const struct tnl_mutable_config *); + + /* + * Returns a linked list of SKBs with tunnel headers (multiple + * packets may be generated in the event of fragmentation). Space + * will have already been allocated at the start of the packet equal + * to sizeof(struct iphdr) + value returned by hdr_len(). The IP + * header will have already been constructed. + */ + struct sk_buff *(*build_header)(struct sk_buff *, + const struct vport *, + const struct tnl_mutable_config *, + struct dst_entry *); }; struct tnl_vport { @@ -61,6 +79,8 @@ struct tnl_vport { /* Protected by RCU. */ struct tnl_mutable_config *mutable; + + atomic_t frag_id; }; int tnl_init(void);