Skip to contentSkip to conversation

src: Add support for adding TOS symbols

PATCH Superseded Alvaro Neira Ayuso 3 participants 5 messages May 23, 2014 – May 27, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

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
index 2c66e9d..b53358c 100644
@@ -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
#1 lore raw
Quoted 14 lines · Alvaro Neira Ayuso

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 +0 -0
index 2c66e9d..b53358c 100644

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 -0
 	TYPE_CT_STATE,
 	TYPE_CT_DIR,
 	TYPE_CT_STATUS,
#2 lore raw

PATCH v2 1/1 src: Add support for adding TOS symbols

In reply to Alvaro Neira Ayuso

This 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
index 2c66e9d..2ddab7d 100644
@@ -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
#4 lore raw

PATCH v3 1/2 src: Add support for adding TOS symbols

In reply to Alvaro Neira Ayuso

From: Á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
index 2c66e9d..2ddab7d 100644
@@ -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