devices.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
#include <time.h>
#include <sys/ioctl.h>
#include <sys/asynchio.h>
#include <net/hton.h>
#include <net/gen/in.h>
#include <net/gen/ether.h>
#include <net/gen/eth_hdr.h>
#include <net/gen/eth_io.h>
#include <net/gen/ip_hdr.h>
#include <net/gen/ip_io.h>
#include <net/gen/udp.h>
#include <net/gen/udp_hdr.h>
#include <net/gen/udp_io.h>
#include <net/gen/dhcp.h>
#include "dhcpd.h"

Include dependency graph for devices.c:

Go to the source code of this file.

Defines

#define N_FDS   1

Functions

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)

Variables

static fd_t fds [N_FDS]
static struct networkfdwaitq


Define Documentation

#define N_FDS   1
 

Definition at line 67 of file devices.c.


Function Documentation

void closedev network_t np,
fdtype_t  fdtype
 

Definition at line 239 of file devices.c.

References arraylimit, closefd(), network::fdp, fds, fd::fdtype, FT_ALL, fd::n, and network::n.

void closefd fd_t fdp  ) 
 

Definition at line 86 of file devices.c.

References asyn, asyn_close(), fd::bp, close, debug, fd::device, fd::fd, network::fdp, fd::fdtype, FT_CLOSED, printf, put_buf(), and fd::since.

Referenced by closedev().

void get_buf buf_t **  bp  ) 
 

Definition at line 29 of file devices.c.

References allocate(), bp, and nil.

Referenced by servdhcp().

void give_buf buf_t **  dbp,
buf_t **  sbp
 

Definition at line 56 of file devices.c.

References nil, and put_buf().

char* ipdev int  n  ) 
 

Definition at line 251 of file devices.c.

References sprintf().

Referenced by main().

network_t* newnetwork void   ) 
 

Definition at line 73 of file devices.c.

References allocate(), memset(), NEVER, and nil.

int opendev network_t np,
fdtype_t  fdtype,
int  compete
 

Definition at line 99 of file devices.c.

References arraylimit, EAGAIN, errno, network::fdp, fds, fd::fdtype, network::flags, FT_ETHERNET, fd::n, network::n, NEVER, NF_BOUND, nil, fd::since, and time_t.

void put_buf buf_t **  bp  ) 
 

Definition at line 47 of file devices.c.

References bp, free, and nil.

Referenced by closefd(), give_buf(), and servdhcp().

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

Definition at line 260 of file devices.c.

References close, fatal(), ioctl, nwio_ipconf::nwic_flags, nwio_ipconf::nwic_ipaddr, NWIC_IPADDR_SET, nwio_ipconf::nwic_mtu, NWIC_MTU_SET, nwio_ipconf::nwic_netmask, NWIC_NETMASK_SET, NWIOSIPCONF, O_RDWR, open, and test.


Variable Documentation

fd_t fds[N_FDS] [static]
 

Definition at line 70 of file devices.c.

Referenced by ar_start_gzip(), closedev(), fdxcmd(), main(), and opendev().

struct network* fdwaitq [static]
 

Definition at line 71 of file devices.c.


Generated on Fri Apr 14 23:02:14 2006 for minix by  doxygen 1.4.6