1 |
/* |
2 |
* Cisco 7200 (Predator) simulation platform. |
3 |
* Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr) |
4 |
* |
5 |
* NetIO Packet Filters. |
6 |
*/ |
7 |
|
8 |
#ifndef __NET_IO_FILTER_H__ |
9 |
#define __NET_IO_FILTER_H__ |
10 |
|
11 |
#include <sys/types.h> |
12 |
#include <sys/socket.h> |
13 |
#include <sys/un.h> |
14 |
#include <pthread.h> |
15 |
#include "utils.h" |
16 |
#include "net_io.h" |
17 |
|
18 |
/* Directions for filters */ |
19 |
#define NETIO_FILTER_DIR_RX 0 |
20 |
#define NETIO_FILTER_DIR_TX 1 |
21 |
|
22 |
/* Find a filter */ |
23 |
netio_pktfilter_t *netio_filter_find(char *name); |
24 |
|
25 |
/* Add a new filter */ |
26 |
int netio_filter_add(netio_pktfilter_t *pf); |
27 |
|
28 |
/* Bind a filter to a NIO */ |
29 |
int netio_filter_bind(netio_desc_t *nio,int direction,char *pf_name); |
30 |
|
31 |
/* Unbind a filter from a NIO */ |
32 |
int netio_filter_unbind(netio_desc_t *nio,int direction); |
33 |
|
34 |
/* Setup a filter */ |
35 |
int netio_filter_setup(netio_desc_t *nio,int direction,int argc,char *argv[]); |
36 |
|
37 |
/* Load all packet filters */ |
38 |
void netio_filter_load_all(void); |
39 |
|
40 |
#endif |