]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tcpopt: make tcptopt structs static
authorFlorian Westphal <fw@strlen.de>
Thu, 13 Jul 2017 13:50:30 +0000 (15:50 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 13 Jul 2017 13:55:23 +0000 (15:55 +0200)
not used outside of tcpopt.c, so unexport from header file and
make them static.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/tcpopt.h
src/tcpopt.c

index 412d02e7ba80fea0326f9601f2a7aae4eb4deea2..f96c04c6ee93912542e5b2052a6470b92dcb0660 100644 (file)
@@ -41,13 +41,4 @@ enum tcpopt_hdr_fields {
        TCPOPTHDR_FIELD_TSVAL,
        TCPOPTHDR_FIELD_TSECR,
 };
-
-extern const struct exthdr_desc tcpopt_eol;
-extern const struct exthdr_desc tcpopt_nop;
-extern const struct exthdr_desc tcpopt_maxseg;
-extern const struct exthdr_desc tcpopt_window;
-extern const struct exthdr_desc tcpopt_sack_permitted;
-extern const struct exthdr_desc tcpopt_sack;
-extern const struct exthdr_desc tcpopt_timestamp;
-
 #endif /* NFTABLES_TCPOPT_H */
index dac4fdb90915a980fc9a929655cebe43bc6f7721..7c6c2557028ab62df453f00e9bba9c177fe5fa88 100644 (file)
@@ -18,7 +18,7 @@ static const struct proto_hdr_template tcpopt_unknown_template =
 #define PHT(__token, __offset, __len) \
        PROTO_HDR_TEMPLATE(__token, &integer_type, BYTEORDER_BIG_ENDIAN, \
                           __offset, __len)
-const struct exthdr_desc tcpopt_eol = {
+static const struct exthdr_desc tcpopt_eol = {
        .name           = "eol",
        .type           = TCPOPT_EOL,
        .templates      = {
@@ -26,7 +26,7 @@ const struct exthdr_desc tcpopt_eol = {
        },
 };
 
-const struct exthdr_desc tcpopt_nop = {
+static const struct exthdr_desc tcpopt_nop = {
        .name           = "noop",
        .type           = TCPOPT_NOP,
        .templates      = {
@@ -34,7 +34,7 @@ const struct exthdr_desc tcpopt_nop = {
        },
 };
 
-const struct exthdr_desc tcptopt_maxseg = {
+static const struct exthdr_desc tcptopt_maxseg = {
        .name           = "maxseg",
        .type           = TCPOPT_MAXSEG,
        .templates      = {
@@ -44,7 +44,7 @@ const struct exthdr_desc tcptopt_maxseg = {
        },
 };
 
-const struct exthdr_desc tcpopt_window = {
+static const struct exthdr_desc tcpopt_window = {
        .name           = "window",
        .type           = TCPOPT_WINDOW,
        .templates      = {
@@ -54,7 +54,7 @@ const struct exthdr_desc tcpopt_window = {
        },
 };
 
-const struct exthdr_desc tcpopt_sack_permitted = {
+static const struct exthdr_desc tcpopt_sack_permitted = {
        .name           = "sack-permitted",
        .type           = TCPOPT_SACK_PERMITTED,
        .templates      = {
@@ -63,7 +63,7 @@ const struct exthdr_desc tcpopt_sack_permitted = {
        },
 };
 
-const struct exthdr_desc tcpopt_sack = {
+static const struct exthdr_desc tcpopt_sack = {
        .name           = "sack",
        .type           = TCPOPT_SACK,
        .templates      = {
@@ -74,7 +74,7 @@ const struct exthdr_desc tcpopt_sack = {
        },
 };
 
-const struct exthdr_desc tcpopt_timestamp = {
+static const struct exthdr_desc tcpopt_timestamp = {
        .name           = "timestamp",
        .type           = TCPOPT_TIMESTAMP,
        .templates      = {
@@ -89,7 +89,7 @@ const struct exthdr_desc tcpopt_timestamp = {
 #define TCPOPT_OBSOLETE ((struct exthdr_desc *)NULL)
 #define TCPOPT_ECHO 6
 #define TCPOPT_ECHO_REPLY 7
-const struct exthdr_desc *tcpopt_protocols[] = {
+static const struct exthdr_desc *tcpopt_protocols[] = {
        [TCPOPT_EOL]            = &tcpopt_eol,
        [TCPOPT_NOP]            = &tcpopt_nop,
        [TCPOPT_MAXSEG]         = &tcptopt_maxseg,