File: f_ext_test.c

package info (click to toggle)
tcng 10b-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,644 kB
  • sloc: ansic: 19,040; pascal: 4,640; yacc: 2,619; sh: 1,914; perl: 1,546; lex: 772; makefile: 751
file content (49 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * f_ext_test.c - Classifier for testing the external interface
 *
 * Written 2001,2004 by Werner Almesberger
 * Copyright 2001 Network Robots
 * Copyright 2004 by Werner Almesberger
 */


#include <stdio.h>
#include <netinet/in.h> /* for utils.h */
#include <linux/types.h> /* for utils.h */

#include "utils.h"
#include "tc_util.h"


#define _C(a,b) a##b
#define C(a,b) _C(a,b)

#define _S(s) #s
#define S(s) _S(s)


static int C(NAME,_parse_opt)(struct filter_util *fu,char *handle,int argc,
  char **argv,struct nlmsghdr *n)
{
	if (argc) {
		fprintf(stderr,"Usage: " S(NAME) "\n");
		return -1;
	}
	if (remove("f_" S(NAME) ".so")) perror("remove f_" S(NAME) ".so");
	return 0;
}


static int C(NAME,_print_opt)(struct filter_util *fu,FILE *f,struct rtattr *opt,
  __u32 handle)
{
	return 0;
}


struct filter_util C(NAME,_util) = {
	NULL,
	S(NAME),
	C(NAME,_parse_opt),
	C(NAME,_print_opt),
};