Flushes all routes out of X25_ROUTE structure.
This ioctl can disrupt other users significantly. For this reason it can only be used by root.
The x25_route_s data structure takes the following form:
typedef struct x25_route_s {
uint32_t index; /* used for reading next route */
u_char r_type;
#define R_NONE 0
#define R_X121_HOST 1
#define R_X121_PREFIX 2
#define R_AEF_HOST 3
#define R_AEF_PREFIX 4
#define R_AEF_SOURCE 5
CONN_ADR x121;
u_char pid_len;
#define MAX_PID_LEN 4
u_char pid[MAX_PID_LEN];
AEF aef;
int linkid;
X25_MACADDR mac;
int use_count;
char pstn_number[16];
} X25_ROUTE;
#include <sys/strupts.h>
struct strioctl ioc ;
int fd ;
X25_ROUTE r;
fd = open("/dev/x25", O,RDW);
/*prepare route*/
initialize
io.ic_cmd = N_X25_FLUSH_ROUTES;
io.ic_timout = 0;
io.ic_len = 0;
io.ic_dp = (char *)NULL;
if (ioctl(x25s, I_STR, &ioc))
perror("ioctl(X25_FLUSH_ROUTES)");
}
}