]> git.ipfire.org Git - thirdparty/bird.git/blob - filter/f-util.c
Split inst->code into inst->code and inst->aux. Both are only 16 bit,
[thirdparty/bird.git] / filter / f-util.c
1 /*
2 * Filters: utility functions
3 *
4 * Copyright 1998 Pavel Machek <pavel@ucw.cz>
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL.
7 */
8
9 #include <stdio.h>
10 #include <fcntl.h>
11 #include <unistd.h>
12 #include <sys/signal.h>
13 #include <setjmp.h>
14
15 #include "nest/bird.h"
16 #include "lib/lists.h"
17 #include "lib/resource.h"
18 #include "lib/socket.h"
19 #include "nest/route.h"
20 #include "nest/protocol.h"
21 #include "nest/iface.h"
22 #include "conf/conf.h"
23 #include "filter/filter.h"
24
25 struct f_inst *
26 f_new_inst(void)
27 {
28 struct f_inst * ret;
29 ret = cfg_alloc(sizeof(struct f_inst));
30 ret->code = ret->aux = 0;
31 ret->arg1 = ret->arg2 = ret->next = NULL;
32 return ret;
33 }
34
35 char *
36 filter_name(struct filter *filter)
37 {
38 if (!filter)
39 return "ACCEPT";
40 else if (filter == FILTER_REJECT)
41 return "REJECT";
42 else
43 return filter->name;
44 }