Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

route-bsd.c File Reference

#include "config.h"
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/route.h>
#include <netinet/in.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "dnet.h"

Go to the source code of this file.

Defines

#define route_t   oroute_t
#define ROUNDUP(a)   ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
#define NEXTSA(s)   ((struct sockaddr *)((u_char *)(s) + ROUNDUP(sizeof(*(s)))))

Functions

static int route_msg (route_t *r, int type, struct addr *dst, struct addr *gw)
route_troute_open (void)
int route_add (route_t *r, const struct route_entry *entry)
int route_delete (route_t *r, const struct route_entry *entry)
int route_get (route_t *r, struct route_entry *entry)
int route_loop (route_t *r, route_handler callback, void *arg)
route_troute_close (route_t *r)


Define Documentation

#define NEXTSA  )     ((struct sockaddr *)((u_char *)(s) + ROUNDUP(sizeof(*(s)))))
 

Definition at line 53 of file route-bsd.c.

Referenced by route_msg().

#define ROUNDUP  )     ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
 

Definition at line 46 of file route-bsd.c.

#define route_t   oroute_t
 

Definition at line 32 of file route-bsd.c.


Function Documentation

int route_add route_t r,
const struct route_entry entry
 

Definition at line 179 of file route-bsd.c.

References memcpy, and route_msg().

route_t* route_close route_t r  ) 
 

Definition at line 496 of file route-bsd.c.

References route_handle::fd, and NULL.

int route_delete route_t r,
const struct route_entry entry
 

Definition at line 192 of file route-bsd.c.

References memcpy, route_get(), and route_msg().

int route_get route_t r,
struct route_entry entry
 

Definition at line 208 of file route-bsd.c.

References route_entry::route_dst, route_entry::route_gw, and route_msg().

int route_loop route_t r,
route_handler  callback,
void *  arg
 

Definition at line 488 of file route-bsd.c.

References errno.

static int route_msg route_t r,
int  type,
struct addr dst,
struct addr gw
[static]
 

Definition at line 76 of file route-bsd.c.

References addr_btos(), addr_net(), addr_ntos(), addr_ston(), addr::addr_type, ADDR_TYPE_IP, errno, route_handle::fd, IP_ADDR_ANY, IP_ADDR_BITS, memset, NEXTSA, NULL, and route_handle::seq.

Referenced by route_add(), route_delete(), and route_get().

route_t* route_open void   ) 
 

Definition at line 158 of file route-bsd.c.

References NULL, and route_close().


Generated on Sun May 14 14:51:22 2006 by  doxygen 1.4.2