blob: 80406f76d29d3512e44c3ab29f8fa0386855772d [file] [log] [blame]
Patrick McHardy38100132006-11-13 19:38:44 +00001/* Shared library add-on to iptables for SCTP matching
2 *
3 * (C) 2003 by Harald Welte <laforge@gnumonks.org>
4 *
5 * This program is distributed under the terms of GNU GPL v2, 1991
6 *
7 * libipt_ecn.c borrowed heavily from libipt_dscp.c
8 *
9 */
Jan Engelhardt32b8e612010-07-23 21:16:14 +020010#include <stdbool.h>
Patrick McHardy38100132006-11-13 19:38:44 +000011#include <stdio.h>
12#include <string.h>
13#include <stdlib.h>
14#include <getopt.h>
15#include <netdb.h>
16#include <ctype.h>
17
Thomas Jaroschecae0c32008-10-23 15:41:27 +020018#include <netinet/in.h>
Yasuyuki KOZAKAI19f29502007-07-24 07:02:26 +000019#include <xtables.h>
Patrick McHardy38100132006-11-13 19:38:44 +000020
Patrick McHardy38100132006-11-13 19:38:44 +000021#include <linux/netfilter/xt_sctp.h>
22
Patrick McHardy38100132006-11-13 19:38:44 +000023#if 0
24#define DEBUGP(format, first...) printf(format, ##first)
25#define static
26#else
27#define DEBUGP(format, fist...)
28#endif
29
30static void
31print_chunk(u_int32_t chunknum, int numeric);
32
Jan Engelhardt181dead2007-10-04 16:27:07 +000033static void sctp_init(struct xt_entry_match *m)
Patrick McHardy38100132006-11-13 19:38:44 +000034{
35 int i;
36 struct xt_sctp_info *einfo = (struct xt_sctp_info *)m->data;
37
38 memset(einfo, 0, sizeof(struct xt_sctp_info));
39
40 for (i = 0; i < XT_NUM_SCTP_FLAGS; i++) {
41 einfo->flag_info[i].chunktype = -1;
42 }
43}
44
Jan Engelhardt181dead2007-10-04 16:27:07 +000045static void sctp_help(void)
Patrick McHardy38100132006-11-13 19:38:44 +000046{
47 printf(
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020048"sctp match options\n"
Jan Engelhardt96727922008-08-13 14:42:41 +020049"[!] --source-port port[:port] match source port(s)\n"
Patrick McHardy38100132006-11-13 19:38:44 +000050" --sport ...\n"
Jan Engelhardt96727922008-08-13 14:42:41 +020051"[!] --destination-port port[:port] match destination port(s)\n"
Patrick McHardy38100132006-11-13 19:38:44 +000052" --dport ...\n"
Jan Engelhardt96727922008-08-13 14:42:41 +020053"[!] --chunk-types (all|any|none) (chunktype[:flags])+ match if all, any or none of\n"
Patrick McHardy38100132006-11-13 19:38:44 +000054" chunktypes are present\n"
Shan Wei4a498502010-06-08 14:16:57 +020055"chunktypes - DATA INIT INIT_ACK SACK HEARTBEAT HEARTBEAT_ACK ABORT SHUTDOWN SHUTDOWN_ACK ERROR COOKIE_ECHO COOKIE_ACK ECN_ECNE ECN_CWR SHUTDOWN_COMPLETE ASCONF ASCONF_ACK FORWARD_TSN ALL NONE\n");
Patrick McHardy38100132006-11-13 19:38:44 +000056}
57
Jan Engelhardt181dead2007-10-04 16:27:07 +000058static const struct option sctp_opts[] = {
Jan Engelhardt32b8e612010-07-23 21:16:14 +020059 {.name = "source-port", .has_arg = true, .val = '1'},
60 {.name = "sport", .has_arg = true, .val = '1'},
61 {.name = "destination-port", .has_arg = true, .val = '2'},
62 {.name = "dport", .has_arg = true, .val = '2'},
63 {.name = "chunk-types", .has_arg = true, .val = '3'},
64 XT_GETOPT_TABLEEND,
Patrick McHardy38100132006-11-13 19:38:44 +000065};
66
67static void
68parse_sctp_ports(const char *portstring,
69 u_int16_t *ports)
70{
71 char *buffer;
72 char *cp;
73
74 buffer = strdup(portstring);
75 DEBUGP("%s\n", portstring);
76 if ((cp = strchr(buffer, ':')) == NULL) {
Jan Engelhardtaae6be92009-01-30 04:24:47 +010077 ports[0] = ports[1] = xtables_parse_port(buffer, "sctp");
Patrick McHardy38100132006-11-13 19:38:44 +000078 }
79 else {
80 *cp = '\0';
81 cp++;
82
Jan Engelhardtaae6be92009-01-30 04:24:47 +010083 ports[0] = buffer[0] ? xtables_parse_port(buffer, "sctp") : 0;
84 ports[1] = cp[0] ? xtables_parse_port(cp, "sctp") : 0xFFFF;
Patrick McHardy38100132006-11-13 19:38:44 +000085
86 if (ports[0] > ports[1])
Jan Engelhardt1829ed42009-02-21 03:29:44 +010087 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +000088 "invalid portrange (min > max)");
89 }
90 free(buffer);
91}
92
93struct sctp_chunk_names {
94 const char *name;
95 unsigned int chunk_type;
96 const char *valid_flags;
97};
98
99/*'ALL' and 'NONE' will be treated specially. */
Jan Engelhardt0e2abed2007-10-04 16:25:58 +0000100static const struct sctp_chunk_names sctp_chunk_names[]
Shan Weib9f458f2010-06-08 14:15:39 +0200101= { { .name = "DATA", .chunk_type = 0, .valid_flags = "----IUBE"},
Patrick McHardy38100132006-11-13 19:38:44 +0000102 { .name = "INIT", .chunk_type = 1, .valid_flags = "--------"},
103 { .name = "INIT_ACK", .chunk_type = 2, .valid_flags = "--------"},
104 { .name = "SACK", .chunk_type = 3, .valid_flags = "--------"},
105 { .name = "HEARTBEAT", .chunk_type = 4, .valid_flags = "--------"},
106 { .name = "HEARTBEAT_ACK", .chunk_type = 5, .valid_flags = "--------"},
107 { .name = "ABORT", .chunk_type = 6, .valid_flags = "-------T"},
108 { .name = "SHUTDOWN", .chunk_type = 7, .valid_flags = "--------"},
109 { .name = "SHUTDOWN_ACK", .chunk_type = 8, .valid_flags = "--------"},
110 { .name = "ERROR", .chunk_type = 9, .valid_flags = "--------"},
111 { .name = "COOKIE_ECHO", .chunk_type = 10, .valid_flags = "--------"},
112 { .name = "COOKIE_ACK", .chunk_type = 11, .valid_flags = "--------"},
113 { .name = "ECN_ECNE", .chunk_type = 12, .valid_flags = "--------"},
114 { .name = "ECN_CWR", .chunk_type = 13, .valid_flags = "--------"},
115 { .name = "SHUTDOWN_COMPLETE", .chunk_type = 14, .valid_flags = "-------T"},
Naohiro Ooiwaecd7f5e2008-02-29 12:45:27 +0000116 { .name = "ASCONF", .chunk_type = 193, .valid_flags = "--------"},
117 { .name = "ASCONF_ACK", .chunk_type = 128, .valid_flags = "--------"},
Shan Wei4a498502010-06-08 14:16:57 +0200118 { .name = "FORWARD_TSN", .chunk_type = 192, .valid_flags = "--------"},
Patrick McHardy38100132006-11-13 19:38:44 +0000119};
120
121static void
122save_chunk_flag_info(struct xt_sctp_flag_info *flag_info,
123 int *flag_count,
124 int chunktype,
125 int bit,
126 int set)
127{
128 int i;
129
130 for (i = 0; i < *flag_count; i++) {
131 if (flag_info[i].chunktype == chunktype) {
132 DEBUGP("Previous match found\n");
133 flag_info[i].chunktype = chunktype;
134 flag_info[i].flag_mask |= (1 << bit);
135 if (set) {
136 flag_info[i].flag |= (1 << bit);
137 }
138
139 return;
140 }
141 }
142
143 if (*flag_count == XT_NUM_SCTP_FLAGS) {
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100144 xtables_error (PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000145 "Number of chunk types with flags exceeds currently allowed limit."
Yasuyuki KOZAKAI19f29502007-07-24 07:02:26 +0000146 "Increasing this limit involves changing IPT_NUM_SCTP_FLAGS and"
Patrick McHardy38100132006-11-13 19:38:44 +0000147 "recompiling both the kernel space and user space modules\n");
148 }
149
150 flag_info[*flag_count].chunktype = chunktype;
151 flag_info[*flag_count].flag_mask |= (1 << bit);
152 if (set) {
153 flag_info[*flag_count].flag |= (1 << bit);
154 }
155 (*flag_count)++;
156}
157
158static void
159parse_sctp_chunk(struct xt_sctp_info *einfo,
160 const char *chunks)
161{
162 char *ptr;
163 char *buffer;
164 unsigned int i, j;
165 int found = 0;
166 char *chunk_flags;
167
168 buffer = strdup(chunks);
169 DEBUGP("Buffer: %s\n", buffer);
170
171 SCTP_CHUNKMAP_RESET(einfo->chunkmap);
172
173 if (!strcasecmp(buffer, "ALL")) {
174 SCTP_CHUNKMAP_SET_ALL(einfo->chunkmap);
175 goto out;
176 }
177
178 if (!strcasecmp(buffer, "NONE")) {
179 SCTP_CHUNKMAP_RESET(einfo->chunkmap);
180 goto out;
181 }
182
183 for (ptr = strtok(buffer, ","); ptr; ptr = strtok(NULL, ",")) {
184 found = 0;
185 DEBUGP("Next Chunk type %s\n", ptr);
186
187 if ((chunk_flags = strchr(ptr, ':')) != NULL) {
188 *chunk_flags++ = 0;
189 }
190
Jan Engelhardt2c69b552009-04-30 19:32:02 +0200191 for (i = 0; i < ARRAY_SIZE(sctp_chunk_names); ++i)
Patrick McHardy38100132006-11-13 19:38:44 +0000192 if (strcasecmp(sctp_chunk_names[i].name, ptr) == 0) {
193 DEBUGP("Chunk num %d\n", sctp_chunk_names[i].chunk_type);
194 SCTP_CHUNKMAP_SET(einfo->chunkmap,
195 sctp_chunk_names[i].chunk_type);
196 found = 1;
197 break;
198 }
Patrick McHardy38100132006-11-13 19:38:44 +0000199 if (!found)
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100200 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000201 "Unknown sctp chunk `%s'", ptr);
202
203 if (chunk_flags) {
204 DEBUGP("Chunk flags %s\n", chunk_flags);
205 for (j = 0; j < strlen(chunk_flags); j++) {
206 char *p;
207 int bit;
208
209 if ((p = strchr(sctp_chunk_names[i].valid_flags,
210 toupper(chunk_flags[j]))) != NULL) {
211 bit = p - sctp_chunk_names[i].valid_flags;
212 bit = 7 - bit;
213
214 save_chunk_flag_info(einfo->flag_info,
215 &(einfo->flag_count), i, bit,
216 isupper(chunk_flags[j]));
217 } else {
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100218 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000219 "Invalid flags for chunk type %d\n", i);
220 }
221 }
222 }
223 }
224out:
225 free(buffer);
226}
227
228static void
229parse_sctp_chunks(struct xt_sctp_info *einfo,
230 const char *match_type,
231 const char *chunks)
232{
233 DEBUGP("Match type: %s Chunks: %s\n", match_type, chunks);
234 if (!strcasecmp(match_type, "ANY")) {
235 einfo->chunk_match_type = SCTP_CHUNK_MATCH_ANY;
236 } else if (!strcasecmp(match_type, "ALL")) {
237 einfo->chunk_match_type = SCTP_CHUNK_MATCH_ALL;
238 } else if (!strcasecmp(match_type, "ONLY")) {
239 einfo->chunk_match_type = SCTP_CHUNK_MATCH_ONLY;
240 } else {
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100241 xtables_error (PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000242 "Match type has to be one of \"ALL\", \"ANY\" or \"ONLY\"");
243 }
244
245 SCTP_CHUNKMAP_RESET(einfo->chunkmap);
246 parse_sctp_chunk(einfo, chunks);
247}
248
249static int
Jan Engelhardt181dead2007-10-04 16:27:07 +0000250sctp_parse(int c, char **argv, int invert, unsigned int *flags,
251 const void *entry, struct xt_entry_match **match)
Patrick McHardy38100132006-11-13 19:38:44 +0000252{
253 struct xt_sctp_info *einfo
254 = (struct xt_sctp_info *)(*match)->data;
255
256 switch (c) {
257 case '1':
258 if (*flags & XT_SCTP_SRC_PORTS)
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100259 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000260 "Only one `--source-port' allowed");
261 einfo->flags |= XT_SCTP_SRC_PORTS;
Jan Engelhardtbf971282009-11-03 19:55:11 +0100262 xtables_check_inverse(optarg, &invert, &optind, 0, argv);
Jan Engelhardtbbe83862009-10-24 00:45:33 +0200263 parse_sctp_ports(optarg, einfo->spts);
Patrick McHardy38100132006-11-13 19:38:44 +0000264 if (invert)
265 einfo->invflags |= XT_SCTP_SRC_PORTS;
266 *flags |= XT_SCTP_SRC_PORTS;
267 break;
268
269 case '2':
270 if (*flags & XT_SCTP_DEST_PORTS)
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100271 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000272 "Only one `--destination-port' allowed");
273 einfo->flags |= XT_SCTP_DEST_PORTS;
Jan Engelhardtbf971282009-11-03 19:55:11 +0100274 xtables_check_inverse(optarg, &invert, &optind, 0, argv);
Jan Engelhardtbbe83862009-10-24 00:45:33 +0200275 parse_sctp_ports(optarg, einfo->dpts);
Patrick McHardy38100132006-11-13 19:38:44 +0000276 if (invert)
277 einfo->invflags |= XT_SCTP_DEST_PORTS;
278 *flags |= XT_SCTP_DEST_PORTS;
279 break;
280
281 case '3':
282 if (*flags & XT_SCTP_CHUNK_TYPES)
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100283 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000284 "Only one `--chunk-types' allowed");
Jan Engelhardtbf971282009-11-03 19:55:11 +0100285 xtables_check_inverse(optarg, &invert, &optind, 0, argv);
Patrick McHardy38100132006-11-13 19:38:44 +0000286
287 if (!argv[optind]
288 || argv[optind][0] == '-' || argv[optind][0] == '!')
Jan Engelhardt1829ed42009-02-21 03:29:44 +0100289 xtables_error(PARAMETER_PROBLEM,
Patrick McHardy38100132006-11-13 19:38:44 +0000290 "--chunk-types requires two args");
291
292 einfo->flags |= XT_SCTP_CHUNK_TYPES;
Jan Engelhardtbbe83862009-10-24 00:45:33 +0200293 parse_sctp_chunks(einfo, optarg, argv[optind]);
Patrick McHardy38100132006-11-13 19:38:44 +0000294 if (invert)
295 einfo->invflags |= XT_SCTP_CHUNK_TYPES;
296 optind++;
297 *flags |= XT_SCTP_CHUNK_TYPES;
298 break;
299
300 default:
301 return 0;
302 }
303 return 1;
304}
305
Patrick McHardy38100132006-11-13 19:38:44 +0000306static char *
307port_to_service(int port)
308{
309 struct servent *service;
310
311 if ((service = getservbyport(htons(port), "sctp")))
312 return service->s_name;
313
314 return NULL;
315}
316
317static void
318print_port(u_int16_t port, int numeric)
319{
320 char *service;
321
322 if (numeric || (service = port_to_service(port)) == NULL)
323 printf("%u", port);
324 else
325 printf("%s", service);
326}
327
328static void
329print_ports(const char *name, u_int16_t min, u_int16_t max,
330 int invert, int numeric)
331{
332 const char *inv = invert ? "!" : "";
333
334 if (min != 0 || max != 0xFFFF || invert) {
335 printf("%s", name);
336 if (min == max) {
337 printf(":%s", inv);
338 print_port(min, numeric);
339 } else {
340 printf("s:%s", inv);
341 print_port(min, numeric);
342 printf(":");
343 print_port(max, numeric);
344 }
345 printf(" ");
346 }
347}
348
349static void
350print_chunk_flags(u_int32_t chunknum, u_int8_t chunk_flags, u_int8_t chunk_flags_mask)
351{
352 int i;
353
354 DEBUGP("type: %d\tflags: %x\tflag mask: %x\n", chunknum, chunk_flags,
355 chunk_flags_mask);
356
357 if (chunk_flags_mask) {
358 printf(":");
359 }
360
361 for (i = 7; i >= 0; i--) {
362 if (chunk_flags_mask & (1 << i)) {
363 if (chunk_flags & (1 << i)) {
364 printf("%c", sctp_chunk_names[chunknum].valid_flags[7-i]);
365 } else {
366 printf("%c", tolower(sctp_chunk_names[chunknum].valid_flags[7-i]));
367 }
368 }
369 }
370}
371
372static void
373print_chunk(u_int32_t chunknum, int numeric)
374{
375 if (numeric) {
376 printf("0x%04X", chunknum);
377 }
378 else {
379 int i;
380
Jan Engelhardt2c69b552009-04-30 19:32:02 +0200381 for (i = 0; i < ARRAY_SIZE(sctp_chunk_names); ++i)
Patrick McHardy38100132006-11-13 19:38:44 +0000382 if (sctp_chunk_names[i].chunk_type == chunknum)
383 printf("%s", sctp_chunk_names[chunknum].name);
Patrick McHardy38100132006-11-13 19:38:44 +0000384 }
385}
386
387static void
Li Zefan1f25b402007-10-18 09:12:49 +0000388print_chunks(const struct xt_sctp_info *einfo, int numeric)
Patrick McHardy38100132006-11-13 19:38:44 +0000389{
Li Zefan1f25b402007-10-18 09:12:49 +0000390 u_int32_t chunk_match_type = einfo->chunk_match_type;
391 const struct xt_sctp_flag_info *flag_info = einfo->flag_info;
392 int flag_count = einfo->flag_count;
Patrick McHardy38100132006-11-13 19:38:44 +0000393 int i, j;
394 int flag;
395
396 switch (chunk_match_type) {
397 case SCTP_CHUNK_MATCH_ANY: printf("any "); break;
398 case SCTP_CHUNK_MATCH_ALL: printf("all "); break;
399 case SCTP_CHUNK_MATCH_ONLY: printf("only "); break;
400 default: printf("Never reach herer\n"); break;
401 }
402
Li Zefan1f25b402007-10-18 09:12:49 +0000403 if (SCTP_CHUNKMAP_IS_CLEAR(einfo->chunkmap)) {
Patrick McHardy38100132006-11-13 19:38:44 +0000404 printf("NONE ");
405 goto out;
406 }
407
Li Zefan1f25b402007-10-18 09:12:49 +0000408 if (SCTP_CHUNKMAP_IS_ALL_SET(einfo->chunkmap)) {
Patrick McHardy38100132006-11-13 19:38:44 +0000409 printf("ALL ");
410 goto out;
411 }
412
413 flag = 0;
414 for (i = 0; i < 256; i++) {
Li Zefan1f25b402007-10-18 09:12:49 +0000415 if (SCTP_CHUNKMAP_IS_SET(einfo->chunkmap, i)) {
Patrick McHardy38100132006-11-13 19:38:44 +0000416 if (flag)
417 printf(",");
418 flag = 1;
419 print_chunk(i, numeric);
420 for (j = 0; j < flag_count; j++) {
421 if (flag_info[j].chunktype == i) {
422 print_chunk_flags(i, flag_info[j].flag,
423 flag_info[j].flag_mask);
424 }
425 }
426 }
427 }
428
429 if (flag)
430 printf(" ");
431out:
432 return;
433}
434
Patrick McHardy38100132006-11-13 19:38:44 +0000435static void
Jan Engelhardt181dead2007-10-04 16:27:07 +0000436sctp_print(const void *ip, const struct xt_entry_match *match, int numeric)
Patrick McHardy38100132006-11-13 19:38:44 +0000437{
438 const struct xt_sctp_info *einfo =
439 (const struct xt_sctp_info *)match->data;
440
441 printf("sctp ");
442
443 if (einfo->flags & XT_SCTP_SRC_PORTS) {
444 print_ports("spt", einfo->spts[0], einfo->spts[1],
445 einfo->invflags & XT_SCTP_SRC_PORTS,
446 numeric);
447 }
448
449 if (einfo->flags & XT_SCTP_DEST_PORTS) {
450 print_ports("dpt", einfo->dpts[0], einfo->dpts[1],
451 einfo->invflags & XT_SCTP_DEST_PORTS,
452 numeric);
453 }
454
455 if (einfo->flags & XT_SCTP_CHUNK_TYPES) {
456 /* FIXME: print_chunks() is used in save() where the printing of '!'
457 s taken care of, so we need to do that here as well */
458 if (einfo->invflags & XT_SCTP_CHUNK_TYPES) {
459 printf("! ");
460 }
Li Zefan1f25b402007-10-18 09:12:49 +0000461 print_chunks(einfo, numeric);
Patrick McHardy38100132006-11-13 19:38:44 +0000462 }
463}
464
Jan Engelhardt181dead2007-10-04 16:27:07 +0000465static void sctp_save(const void *ip, const struct xt_entry_match *match)
Patrick McHardy38100132006-11-13 19:38:44 +0000466{
467 const struct xt_sctp_info *einfo =
468 (const struct xt_sctp_info *)match->data;
469
470 if (einfo->flags & XT_SCTP_SRC_PORTS) {
471 if (einfo->invflags & XT_SCTP_SRC_PORTS)
472 printf("! ");
473 if (einfo->spts[0] != einfo->spts[1])
474 printf("--sport %u:%u ",
475 einfo->spts[0], einfo->spts[1]);
476 else
477 printf("--sport %u ", einfo->spts[0]);
478 }
479
480 if (einfo->flags & XT_SCTP_DEST_PORTS) {
481 if (einfo->invflags & XT_SCTP_DEST_PORTS)
482 printf("! ");
483 if (einfo->dpts[0] != einfo->dpts[1])
484 printf("--dport %u:%u ",
485 einfo->dpts[0], einfo->dpts[1]);
486 else
487 printf("--dport %u ", einfo->dpts[0]);
488 }
489
490 if (einfo->flags & XT_SCTP_CHUNK_TYPES) {
491 if (einfo->invflags & XT_SCTP_CHUNK_TYPES)
492 printf("! ");
493 printf("--chunk-types ");
494
Li Zefan1f25b402007-10-18 09:12:49 +0000495 print_chunks(einfo, 0);
Patrick McHardy38100132006-11-13 19:38:44 +0000496 }
497}
498
Jan Engelhardt181dead2007-10-04 16:27:07 +0000499static struct xtables_match sctp_match = {
Yasuyuki KOZAKAI19f29502007-07-24 07:02:26 +0000500 .name = "sctp",
Jan Engelhardtc5e85732009-06-12 20:55:44 +0200501 .family = NFPROTO_UNSPEC,
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +0200502 .version = XTABLES_VERSION,
Yasuyuki KOZAKAI19f29502007-07-24 07:02:26 +0000503 .size = XT_ALIGN(sizeof(struct xt_sctp_info)),
504 .userspacesize = XT_ALIGN(sizeof(struct xt_sctp_info)),
Jan Engelhardt181dead2007-10-04 16:27:07 +0000505 .help = sctp_help,
506 .init = sctp_init,
507 .parse = sctp_parse,
508 .print = sctp_print,
509 .save = sctp_save,
510 .extra_opts = sctp_opts,
Patrick McHardy38100132006-11-13 19:38:44 +0000511};
512
513void _init(void)
514{
Jan Engelhardt181dead2007-10-04 16:27:07 +0000515 xtables_register_match(&sctp_match);
Patrick McHardy38100132006-11-13 19:38:44 +0000516}