src/commands/dhcpd/dhcpd.h File Reference

#include <minix/paths.h>

Go to the source code of this file.

Classes

struct  buf
struct  fd
struct  network

Defines

#define nil   ((void*)0)
#define PATH_DHCPCONF   _PATH_DHCPCONF
#define PATH_DHCPPID   _PATH_DHCPPID
#define PATH_DHCPCACHE   _PATH_DHCPCACHE
#define PATH_DHCPPOOL   _PATH_DHCPPOOL
#define CLID_MAX   32
#define EXTERN   extern
#define arraysize(a)   (sizeof(a) / sizeof((a)[0]))
#define arraylimit(a)   ((a) + arraysize(a))
#define between(a, c, z)
#define B(a)   ((u8_t *) (a))
#define NEVER   (sizeof(time_t) <= sizeof(int) ? INT_MAX : LONG_MAX)
#define DELTA_FIRST   4
#define DELTA_FAST   64
#define DELTA_SLOW   512
#define N_SOLICITS   3
#define DELTA_SOL   3
#define DELTA_ADV   2048
#define BUF_ETH_SIZE   (ETH_MAX_PACK_SIZE)
#define BUF_IP_SIZE   (BUF_ETH_SIZE - sizeof(eth_hdr_t))
#define BUF_UDP_SIZE
#define FT_ALL   FT_CLOSED
#define NF_NEGOTIATING   0x001
#define NF_BOUND   0x002
#define NF_SERVING   0x004
#define NF_RELAYING   0x008
#define NF_WAIT   0x010
#define NF_IRDP   0x020
#define NF_CONFLICT   0x040
#define NF_POSSESSIVE   0x080
#define NF_INFORM   0x100
#define gettag(dp, st, pd, pl)   dhcp_gettag((dp), (st), (pd), (pl))

Typedefs

typedef struct buf buf_t
typedef struct fd fd_t
typedef struct network network_t

Enumerations

enum  fdtype_t {
  FT_CLOSED, FT_ETHERNET, FT_ICMP, FT_BOOTPC,
  FT_BOOTPS
}
enum  nettype_t { NT_IP, NT_SINK, NT_ETHERNET }

Functions

void report (const char *label)
void fatal (const char *label)
void * allocate (size_t size)
int ifname2if (const char *name)
network_tif2net (int n)
void get_buf (buf_t **bp)
void put_buf (buf_t **bp)
void give_buf (buf_t **dbp, buf_t **sbp)
network_tnewnetwork (void)
void closefd (fd_t *fdp)
int opendev (network_t *np, fdtype_t fdtype, int compete)
void closedev (network_t *np, fdtype_t fdtype)
char * ipdev (int n)
void set_ipconf (char *device, ipaddr_t ip, ipaddr_t mask, unsigned mtu)
void udp2ether (buf_t *bp, network_t *np)
int ether2udp (buf_t *bp)
void make_arp (buf_t *bp, network_t *np)
int is_arp_me (buf_t *bp, network_t *np)
void icmp_solicit (buf_t *bp)
void icmp_advert (buf_t *bp, network_t *np)
ipaddr_t icmp_is_advert (buf_t *bp)
void settag (dhcp_t *dp, int tag, void *data, size_t len)
char * cidr_ntoa (ipaddr_t addr, ipaddr_t mask)
void ether2clid (u8_t *clid, ether_addr_t *eth)
void initdhcpconf (void)
int makedhcp (dhcp_t *dp, u8_t *class, size_t calen, u8_t *client, size_t cilen, ipaddr_t ip, ipaddr_t ifip, network_t *np)
char * dhcptypename (int type)
void printdhcp (dhcp_t *dp)

Variables

EXTERN char * program
char * configfile
char * poolfile
EXTERN int serving
EXTERN unsigned test
EXTERN unsigned debug
EXTERN asynchio_t asyn
EXTERN u16_t port_server
EXTERN u16_t port_client
EXTERN time_t start
EXTERN time_t now
EXTERN time_t event


Define Documentation

#define arraylimit ( a   )     ((a) + arraysize(a))

Definition at line 35 of file dhcpd.h.

#define arraysize ( a   )     (sizeof(a) / sizeof((a)[0]))

Definition at line 34 of file dhcpd.h.

#define B ( a   )     ((u8_t *) (a))

Definition at line 41 of file dhcpd.h.

#define between ( a,
c,
 ) 

Value:

(sizeof(c) <= sizeof(unsigned) ? \
        (unsigned) (c) - (a) <= (unsigned) (z) - (a) : \
        (unsigned long) (c) - (a) <= (unsigned long) (z) - (a))

Definition at line 36 of file dhcpd.h.

#define BUF_ETH_SIZE   (ETH_MAX_PACK_SIZE)

Definition at line 68 of file dhcpd.h.

#define BUF_IP_SIZE   (BUF_ETH_SIZE - sizeof(eth_hdr_t))

Definition at line 69 of file dhcpd.h.

#define BUF_UDP_SIZE

Value:

(BUF_IP_SIZE - sizeof(ip_hdr_t) - sizeof(udp_hdr_t) \
                                + sizeof(udp_io_hdr_t))

Definition at line 70 of file dhcpd.h.

#define CLID_MAX   32

Definition at line 16 of file dhcpd.h.

#define DELTA_ADV   2048

Definition at line 54 of file dhcpd.h.

#define DELTA_FAST   64

Definition at line 50 of file dhcpd.h.

#define DELTA_FIRST   4

Definition at line 49 of file dhcpd.h.

#define DELTA_SLOW   512

Definition at line 51 of file dhcpd.h.

#define DELTA_SOL   3

Definition at line 53 of file dhcpd.h.

#define EXTERN   extern

Definition at line 19 of file dhcpd.h.

#define FT_ALL   FT_CLOSED

Definition at line 76 of file dhcpd.h.

#define gettag ( dp,
st,
pd,
pl   )     dhcp_gettag((dp), (st), (pd), (pl))

Definition at line 151 of file dhcpd.h.

#define N_SOLICITS   3

Definition at line 52 of file dhcpd.h.

#define NEVER   (sizeof(time_t) <= sizeof(int) ? INT_MAX : LONG_MAX)

Definition at line 48 of file dhcpd.h.

#define NF_BOUND   0x002

Definition at line 114 of file dhcpd.h.

#define NF_CONFLICT   0x040

Definition at line 119 of file dhcpd.h.

#define NF_INFORM   0x100

Definition at line 121 of file dhcpd.h.

#define NF_IRDP   0x020

Definition at line 118 of file dhcpd.h.

#define NF_NEGOTIATING   0x001

Definition at line 113 of file dhcpd.h.

#define NF_POSSESSIVE   0x080

Definition at line 120 of file dhcpd.h.

#define NF_RELAYING   0x008

Definition at line 116 of file dhcpd.h.

#define NF_SERVING   0x004

Definition at line 115 of file dhcpd.h.

#define NF_WAIT   0x010

Definition at line 117 of file dhcpd.h.

#define nil   ((void*)0)

Definition at line 6 of file dhcpd.h.

#define PATH_DHCPCACHE   _PATH_DHCPCACHE

Definition at line 13 of file dhcpd.h.

#define PATH_DHCPCONF   _PATH_DHCPCONF

Definition at line 11 of file dhcpd.h.

#define PATH_DHCPPID   _PATH_DHCPPID

Definition at line 12 of file dhcpd.h.

#define PATH_DHCPPOOL   _PATH_DHCPPOOL

Definition at line 14 of file dhcpd.h.


Typedef Documentation

typedef struct buf buf_t

typedef struct fd fd_t

typedef struct network network_t


Enumeration Type Documentation

enum fdtype_t

Enumerator:
FT_CLOSED 
FT_ETHERNET 
FT_ICMP 
FT_BOOTPC 
FT_BOOTPS 

Definition at line 74 of file dhcpd.h.

enum nettype_t

Enumerator:
NT_IP 
NT_SINK 
NT_ETHERNET 

Definition at line 88 of file dhcpd.h.


Function Documentation

void* allocate ( size_t  size  ) 

Definition at line 18 of file misc.c.

char* cidr_ntoa ( ipaddr_t  addr,
ipaddr_t  mask 
)

Definition at line 145 of file tags.c.

void closedev ( network_t np,
fdtype_t  fdtype 
)

Definition at line 241 of file devices.c.

void closefd ( fd_t fdp  ) 

Definition at line 86 of file devices.c.

char* dhcptypename ( int  type  ) 

Definition at line 841 of file tags.c.

void ether2clid ( u8_t clid,
ether_addr_t eth 
)

Definition at line 193 of file tags.c.

int ether2udp ( buf_t bp  ) 

Definition at line 87 of file ether.c.

void fatal ( const char *  label  ) 

Definition at line 57 of file dhcpd.c.

void get_buf ( buf_t **  bp  ) 

Definition at line 29 of file devices.c.

void give_buf ( buf_t **  dbp,
buf_t **  sbp 
)

Definition at line 56 of file devices.c.

void icmp_advert ( buf_t bp,
network_t np 
)

Definition at line 167 of file ether.c.

ipaddr_t icmp_is_advert ( buf_t bp  ) 

Definition at line 186 of file ether.c.

void icmp_solicit ( buf_t bp  ) 

Definition at line 152 of file ether.c.

network_t* if2net ( int  n  ) 

Definition at line 91 of file dhcpd.c.

int ifname2if ( const char *  name  ) 

Definition at line 78 of file dhcpd.c.

void initdhcpconf ( void   ) 

Definition at line 361 of file tags.c.

char* ipdev ( int  n  ) 

Definition at line 253 of file devices.c.

int is_arp_me ( buf_t bp,
network_t np 
)

Definition at line 132 of file ether.c.

void make_arp ( buf_t bp,
network_t np 
)

Definition at line 113 of file ether.c.

int makedhcp ( dhcp_t dp,
u8_t class,
size_t  calen,
u8_t client,
size_t  cilen,
ipaddr_t  ip,
ipaddr_t  ifip,
network_t np 
)

Definition at line 518 of file tags.c.

network_t* newnetwork ( void   ) 

Definition at line 73 of file devices.c.

int opendev ( network_t np,
fdtype_t  fdtype,
int  compete 
)

Definition at line 99 of file devices.c.

void printdhcp ( dhcp_t dp  ) 

Definition at line 850 of file tags.c.

void put_buf ( buf_t **  bp  ) 

Definition at line 47 of file devices.c.

void report ( const char *  label  ) 

Definition at line 48 of file dhcpd.c.

void set_ipconf ( char *  device,
ipaddr_t  ip,
ipaddr_t  mask,
unsigned  mtu 
)

Definition at line 262 of file devices.c.

void settag ( dhcp_t dp,
int  tag,
void *  data,
size_t  len 
)

Definition at line 35 of file tags.c.

void udp2ether ( buf_t bp,
network_t np 
)

Definition at line 54 of file ether.c.


Variable Documentation

EXTERN asynchio_t asyn

Definition at line 28 of file dhcpd.h.

char* configfile

Definition at line 36 of file dhcpd.c.

EXTERN unsigned debug

Definition at line 27 of file dhcpd.h.

EXTERN time_t event

Definition at line 45 of file dhcpd.h.

EXTERN time_t now

Definition at line 44 of file dhcpd.h.

char* poolfile

Definition at line 37 of file dhcpd.c.

Definition at line 32 of file dhcpd.h.

Definition at line 31 of file dhcpd.h.

EXTERN char* program

Definition at line 22 of file dhcpd.h.

EXTERN int serving

Definition at line 25 of file dhcpd.h.

EXTERN time_t start

Definition at line 44 of file dhcpd.h.

EXTERN unsigned test

Definition at line 26 of file dhcpd.h.


Generated on Tue Mar 9 04:36:28 2010 for Minix by  doxygen 1.5.8