diff options
author | Patrick McHardy <kaber@trash.net> | 2015-11-25 16:50:19 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-11-25 16:50:19 +0000 |
commit | e6c9174e13b27385241b9ce9767d00b171d406ab (patch) | |
tree | c592aca1d196f904c731ba6a8771eb17f2301964 /src | |
parent | 6d46f18fdf7554fa39b50405358fd0772b14581e (diff) |
proto: add checksum key information to struct proto_desc
The checksum key is used to determine the correct position where to update
the checksum for the payload statement.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/proto.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/proto.c b/src/proto.c index 28b93cbc..89ec2821 100644 --- a/src/proto.c +++ b/src/proto.c @@ -321,6 +321,7 @@ static const struct datatype icmp_type_type = { const struct proto_desc proto_icmp = { .name = "icmp", .base = PROTO_BASE_TRANSPORT_HDR, + .checksum_key = ICMPHDR_CHECKSUM, .templates = { [ICMPHDR_TYPE] = ICMPHDR_TYPE("type", &icmp_type_type, type), [ICMPHDR_CODE] = ICMPHDR_FIELD("code", code), @@ -343,6 +344,7 @@ const struct proto_desc proto_icmp = { const struct proto_desc proto_udp = { .name = "udp", .base = PROTO_BASE_TRANSPORT_HDR, + .checksum_key = UDPHDR_CHECKSUM, .templates = { [UDPHDR_SPORT] = INET_SERVICE("sport", struct udphdr, source), [UDPHDR_DPORT] = INET_SERVICE("dport", struct udphdr, dest), @@ -398,6 +400,7 @@ static const struct datatype tcp_flag_type = { const struct proto_desc proto_tcp = { .name = "tcp", .base = PROTO_BASE_TRANSPORT_HDR, + .checksum_key = TCPHDR_CHECKSUM, .templates = { [TCPHDR_SPORT] = INET_SERVICE("sport", struct tcphdr, source), [TCPHDR_DPORT] = INET_SERVICE("dport", struct tcphdr, dest), @@ -491,6 +494,7 @@ const struct proto_desc proto_sctp = { const struct proto_desc proto_ip = { .name = "ip", .base = PROTO_BASE_NETWORK_HDR, + .checksum_key = IPHDR_CHECKSUM, .protocol_key = IPHDR_PROTOCOL, .protocols = { PROTO_LINK(IPPROTO_ICMP, &proto_icmp), @@ -563,6 +567,7 @@ static const struct datatype icmp6_type_type = { const struct proto_desc proto_icmp6 = { .name = "icmpv6", .base = PROTO_BASE_TRANSPORT_HDR, + .checksum_key = ICMP6HDR_CHECKSUM, .templates = { [ICMP6HDR_TYPE] = ICMP6HDR_TYPE("type", &icmp6_type_type, icmp6_type), [ICMP6HDR_CODE] = ICMP6HDR_FIELD("code", icmp6_code), |