src: Add support for adding TOS symbols
PATCH 1/1 src: Add support for adding TOS symbols
This patch allows to add type of service using symbols not only with mask.
--- include/datatype.h | 2 ++ src/proto.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-)
include/datatype.h +2 -0
@@ -35,6 +35,7 @@* @TYPE_CT_STATUS: conntrack status (bitmask subtype) * @TYPE_ICMP6_TYPE: ICMPv6 type codes (integer subtype) * @TYPE_CT_LABEL: Conntrack Label (bitmask subtype) +* @TYPE_TOS: Type of service */ enum datatypes {TYPE_INVALID ,
@@ -63,6 +64,7 @@ enum datatypes {TYPE_TC_HANDLE ,TYPE_UID ,TYPE_GID , +TYPE_TOS ,TYPE_CT_STATE ,TYPE_CT_DIR , TYPE_CT_STATUS,
src/proto.c +59 -1
80 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Pablo Neira Ayuso
maintainerQuoted 14 lines · Alvaro Neira Ayuso
This patch allows to add type of service using symbols not only with mask.
Signed-off-by Alvaro Neira Ayuso <[email protected]>--- include/datatype.h | 2 ++ src/proto.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-)include/datatype.h +0
-0
include/datatype.h line 38
Quoted 4 lines
include/datatype.h +1
-0@@ -35,6 +35,7 @@* @TYPE_CT_STATUS: conntrack status (bitmask subtype) * @TYPE_ICMP6_TYPE: ICMPv6 type codes (integer subtype) * @TYPE_CT_LABEL: Conntrack Label (bitmask subtype) +* @TYPE_TOS: Type of service
^^^^^
Minor nitpick: Missing comment above regarding the subtype.
include/datatype.h enum datatypes { · line 67
Quoted 8 lines
include/datatype.h +1
-0*/ enum datatypes {TYPE_INVALID ,@@ -63,6 +64,7 @@ enum datatypes {TYPE_TC_HANDLE ,TYPE_UID ,TYPE_GID , + TYPE_TOS,
You have to add this to the end of the list of enum.
The datatypes are used in the sets keytype, nft needs them to interpret the elements. If you add this here and someone upgrades nft, it will break.
Quoted 3 lines
include/datatype.h +0
-0TYPE_CT_STATE ,TYPE_CT_DIR , TYPE_CT_STATUS,
PATCH v2 1/1 src: Add support for adding TOS symbols
In reply to Alvaro Neira AyusoThis patch allows to add type of service using symbols not only with mask.
---
[changes in v2]
* I have added the TYPE_TOS in the end of enum datatypes.
* I have added the subtypes of TYPE_TOS in the comment.
include/datatype.h | 2 ++ src/proto.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-)
include/datatype.h +2 -0
@@ -35,6 +35,7 @@* @TYPE_CT_STATUS: conntrack status (bitmask subtype) * @TYPE_ICMP6_TYPE: ICMPv6 type codes (integer subtype) * @TYPE_CT_LABEL: Conntrack Label (bitmask subtype) +* @TYPE_TOS: Type of service (integer subtype) */ enum datatypes {TYPE_INVALID ,
@@ -68,6 +69,7 @@ enum datatypes {TYPE_CT_STATUS ,TYPE_ICMP6_TYPE ,TYPE_CT_LABEL , +TYPE_TOS , __TYPE_MAX };#define TYPE_MAX (__TYPE_MAX - 1)
src/proto.c +59 -1
80 lines not on this page · raw message
Signature · 1 line
1.7.10.4
What for?
http://tools.ietf.org/html/rfc1349 (TOS) is obsoleted by
http://tools.ietf.org/html/rfc2474 (DSCP)
Furthermore minimize cost conflicts with current uses (ECN).
Does anyone even use those old definitions?
- Maciej
PATCH v3 1/2 src: Add support for adding TOS symbols
In reply to Alvaro Neira AyusoFrom: Álvaro Neira Ayuso <[email protected]>
This patch allows to add type of service using symbols not only with mask.
---
[changes in v3]
* I have changed the function IPHDR_TOS for adding the struct datatype like a parameter. With this changes we have a general function that we can use for adding DSCP support.
include/datatype.h | 2 ++ src/proto.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-)
include/datatype.h +2 -0
@@ -35,6 +35,7 @@* @TYPE_CT_STATUS: conntrack status (bitmask subtype) * @TYPE_ICMP6_TYPE: ICMPv6 type codes (integer subtype) * @TYPE_CT_LABEL: Conntrack Label (bitmask subtype) +* @TYPE_TOS: Type of service (integer subtype) */ enum datatypes {TYPE_INVALID ,
@@ -68,6 +69,7 @@ enum datatypes {TYPE_CT_STATUS ,TYPE_ICMP6_TYPE ,TYPE_CT_LABEL , +TYPE_TOS , __TYPE_MAX };#define TYPE_MAX (__TYPE_MAX - 1)
src/proto.c +59 -1
80 lines not on this page · raw message
Signature · 6 lines
1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html