forked from torvalds/linux
-
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/sched: add ACT_CSUM action to update packets checksums
net/sched: add ACT_CSUM action to update packets checksums ACT_CSUM can be called just after ACT_PEDIT in order to re-compute some altered checksums in IPv4 and IPv6 packets. The following checksums are supported by this patch: - IPv4: IPv4 header, ICMP, IGMP, TCP, UDP & UDPLite - IPv6: ICMPv6, TCP, UDP & UDPLite It's possible to request in the same action to update different kind of checksums, if the packets flow mix TCP, UDP and UDPLite, ... An example of usage is done in the associated iproute2 patch. Version 3 changes: - remove useless goto instructions - improve IPv6 hop options decoding Version 2 changes: - coding style correction - remove useless arguments of some functions - use stack in tcf_csum_dump() - add tcf_csum_skb_nextlayer() to factor code Signed-off-by: Gregoire Baron <[email protected]> Acked-by: jamal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
6 changed files
with
654 additions
and
0 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
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,32 @@ | ||
#ifndef __LINUX_TC_CSUM_H | ||
#define __LINUX_TC_CSUM_H | ||
|
||
#include <linux/types.h> | ||
#include <linux/pkt_cls.h> | ||
|
||
#define TCA_ACT_CSUM 16 | ||
|
||
enum { | ||
TCA_CSUM_UNSPEC, | ||
TCA_CSUM_PARMS, | ||
TCA_CSUM_TM, | ||
__TCA_CSUM_MAX | ||
}; | ||
#define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1) | ||
|
||
enum { | ||
TCA_CSUM_UPDATE_FLAG_IPV4HDR = 1, | ||
TCA_CSUM_UPDATE_FLAG_ICMP = 2, | ||
TCA_CSUM_UPDATE_FLAG_IGMP = 4, | ||
TCA_CSUM_UPDATE_FLAG_TCP = 8, | ||
TCA_CSUM_UPDATE_FLAG_UDP = 16, | ||
TCA_CSUM_UPDATE_FLAG_UDPLITE = 32 | ||
}; | ||
|
||
struct tc_csum { | ||
tc_gen; | ||
|
||
__u32 update_flags; | ||
}; | ||
|
||
#endif /* __LINUX_TC_CSUM_H */ |
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,15 @@ | ||
#ifndef __NET_TC_CSUM_H | ||
#define __NET_TC_CSUM_H | ||
|
||
#include <linux/types.h> | ||
#include <net/act_api.h> | ||
|
||
struct tcf_csum { | ||
struct tcf_common common; | ||
|
||
u32 update_flags; | ||
}; | ||
#define to_tcf_csum(pc) \ | ||
container_of(pc,struct tcf_csum,common) | ||
|
||
#endif /* __NET_TC_CSUM_H */ |
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
Oops, something went wrong.