summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-07-13 15:50:30 +0200
committerFlorian Westphal <fw@strlen.de>2017-07-13 15:55:23 +0200
commit4311d0939bd20a11a7a4bfae7462a02c986fdaa0 (patch)
treebff3d5d9bb2ab59bd189d354a0f50b93abe44402
parent5de112c239ab97ebaba5a935d29504bff0586be7 (diff)
tcpopt: make tcptopt structs static
not used outside of tcpopt.c, so unexport from header file and make them static. Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--include/tcpopt.h9
-rw-r--r--src/tcpopt.c16
2 files changed, 8 insertions, 17 deletions
diff --git a/include/tcpopt.h b/include/tcpopt.h
index 412d02e7..f96c04c6 100644
--- a/include/tcpopt.h
+++ b/include/tcpopt.h
@@ -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 */
diff --git a/src/tcpopt.c b/src/tcpopt.c
index dac4fdb9..7c6c2557 100644
--- a/src/tcpopt.c
+++ b/src/tcpopt.c
@@ -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,