| 1 |
/* |
| 2 |
* Cisco router simulation platform. |
| 3 |
* Copyright (c) 2005,2006 Christophe Fillot ([email protected]) |
| 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 |
#define NETIO_FILTER_DIR_BOTH 2 |
| 22 |
|
| 23 |
/* Find a filter */ |
| 24 |
netio_pktfilter_t *netio_filter_find(char *name); |
| 25 |
|
| 26 |
/* Add a new filter */ |
| 27 |
int netio_filter_add(netio_pktfilter_t *pf); |
| 28 |
|
| 29 |
/* Bind a filter to a NIO */ |
| 30 |
int netio_filter_bind(netio_desc_t *nio,int direction,char *pf_name); |
| 31 |
|
| 32 |
/* Unbind a filter from a NIO */ |
| 33 |
int netio_filter_unbind(netio_desc_t *nio,int direction); |
| 34 |
|
| 35 |
/* Setup a filter */ |
| 36 |
int netio_filter_setup(netio_desc_t *nio,int direction,int argc,char *argv[]); |
| 37 |
|
| 38 |
/* Load all packet filters */ |
| 39 |
void netio_filter_load_all(void); |
| 40 |
|
| 41 |
#endif |