plan 9 kernel history: overview | file list | diff list

1997/0423/ip/ip.h (diff list | history)

1997/0417/sys/src/9/ip/ip.h:3,101997/0423/sys/src/9/ip/ip.h:3,12 (short | long | prev | next)
1997/0327    
typedef struct	Conv	Conv; 
typedef struct	Fs	Fs; 
typedef union	Hwaddr	Hwaddr; 
1997/0423    
typedef struct	Ifcconv	Ifcconv; 
1997/0327    
typedef struct	Iproute	Iproute; 
typedef struct	Media	Media; 
1997/0423    
typedef struct	Multicast	Multicast; 
1997/0327    
typedef struct	Proto	Proto; 
typedef struct	Pstate	Pstate; 
typedef struct	Tcpc	Tcpc; 
1997/0417/sys/src/9/ip/ip.h:19,261997/0423/sys/src/9/ip/ip.h:21,31
1997/0327    
 
	MAXTTL=		255, 
 
1997/0423    
	Ipaddrlen=	4, 
1997/0327    
	Ipbcast=	0xffffffff,	/* ip broadcast address */ 
	Ipbcastobs=	0,		/* obsolete (but still used) ip broadcast addr */ 
1997/0423    
	Ipallsys=	0xe0000001,	/* multicast for all systems */ 
	Ipallrouter=	0xe0000002,	/* multicast for all routers */ 
1997/0327    
}; 
 
enum 
1997/0417/sys/src/9/ip/ip.h:87,971997/0423/sys/src/9/ip/ip.h:92,112
1997/0327    
	MPACKET, 
}; 
 
1997/0423    
/* one per multicast address per medium */ 
struct Multicast 
{ 
	Ipaddr	addr; 
	int	ref; 
	int	timeout; 
	Multicast *next; 
}; 
 
1997/0327    
struct Media 
{ 
	int	type;		/* Media type */ 
	Chan*	mchan;		/* Data channel */ 
	Chan*	achan;		/* Arp channel */ 
1997/0423    
	Chan*	cchan;		/* Control channel */ 
1997/0327    
	char*	dev;		/* device mfd points to */ 
	Ipaddr	myip[5]; 
	Ipaddr	mymask; 
1997/0417/sys/src/9/ip/ip.h:108,1131997/0423/sys/src/9/ip/ip.h:123,132
1997/0327    
	int	inuse; 
	Conv	*c;		/* for packet interface */ 
 
1997/0423    
	QLock	mlock;		/* lock for changing *multi */ 
	Multicast *multi;	/* list of multicast addresses we're listening to */ 
	int	mactive;	/* number of active multicast addresses */ 
 
1997/0327    
	Media*	link; 
}; 
int	Mediaforme(byte*); 
1997/0417/sys/src/9/ip/ip.h:122,1321997/0423/sys/src/9/ip/ip.h:141,154
1997/0327    
Ipaddr	Mediagetraddr(Media*); 
void	Mediawrite(Media*, Block*, byte*); 
1997/0417    
int	Mediaifcread(char*, ulong, int); 
1997/0327    
char*	Mediaifcwrite(char*, int); 
1997/0423    
char*	Mediaifcwrite(Ifcconv*, char*, int); 
1997/0327    
void	Mediaresolver(Media*); 
void	Mediaread(Media*); 
int	Mediaarp(Media*, Block*, byte*, Hwaddr*); 
Media*	Mediafind(Iproute*); 
1997/0423    
Multicast*	Mediacopymulti(Media*); 
void	Mediamulticastadd(Media*, Ifcconv*, Ipaddr); 
void	Mediamulticastrem(Media*, Ipaddr); 
1997/0327    
 
/* 
 *  one per multiplexed protocol 
1997/0417/sys/src/9/ip/ip.h:144,1501997/0423/sys/src/9/ip/ip.h:166,172
1997/0327    
	int		(*state)(char**, Conv*); 
	void		(*create)(Conv*); 
	void		(*close)(Conv*); 
	void		(*rcv)(Block*); 
1997/0423    
	void		(*rcv)(Media*, Block*); 
1997/0327    
	char*		(*ctl)(Conv*, char**, int); 
	void		(*advise)(Block*, char*); 
 
1997/0417/sys/src/9/ip/ip.h:195,2001997/0423/sys/src/9/ip/ip.h:217,223
1997/0327    
	Loggre=		1<<9, 
	Logppp=		1<<10, 
	Logtcpmsg=	1<<11, 
1997/0423    
	Logigmp=	1<<12, 
1997/0327    
}; 
 
extern int	logmask;	/* mask of things to debug */ 
1997/0417/sys/src/9/ip/ip.h:213,2211997/0423/sys/src/9/ip/ip.h:236,246
1997/0327    
extern Fs	fs; 
extern Media*	media; 
extern int	iprouting;	/* true if routing turned on */ 
1997/0423    
extern void	(*igmpreportfn)(Media*, byte*); 
1997/0327    
 
int	arpread(byte*, ulong, int); 
char*	arpwrite(char*, int); 
1997/0423    
void	closeifcconv(Ifcconv*); 
1997/0327    
Ipaddr	defmask(Ipaddr); 
int	eipconv(va_list*, Fconv*); 
int	equivip(byte*, byte*); 
1997/0417/sys/src/9/ip/ip.h:226,2361997/0423/sys/src/9/ip/ip.h:251,264
1997/0327    
ushort	ipcsum(byte*); 
void	(*ipextprotoiput)(Block*); 
Ipaddr	ipgetsrc(byte*); 
void	ipiput(Block*); 
1997/0423    
void	ipiput(Media*, Block*); 
1997/0327    
void	ipoput(Block*, int, int); 
int	ipstats(char*, int); 
1997/0423    
int	ismcast(byte*); 
int	isbmcast(byte*); 
1997/0327    
byte*	logctl(byte*); 
void	maskip(byte*, byte*, byte*); 
1997/0423    
Ifcconv* newifcconv(void); 
1997/0327    
ulong	nhgetl(byte*); 
ushort	nhgets(byte*); 
void	(*pktifcrcv)(Conv*, Block*); 
1997/0417/sys/src/9/ip/ip.h:237,2441997/0423/sys/src/9/ip/ip.h:265,272
1997/0327    
ushort	ptclcsum(Block*, int, int); 
int	pullblock(Block**, int); 
Block*	pullupblock(Block*, int); 
char*	routeadd(Ipaddr, Ipaddr, Ipaddr); 
void	routedelete(ulong, ulong); 
1997/0423    
char*	routeadd(Ipaddr, Ipaddr, Ipaddr, Media *m); 
void	routedelete(ulong, ulong, Media *m); 
1997/0327    
int	routeread(byte*, ulong, int); 
char*	routewrite(char*, int); 
 
1997/0417/sys/src/9/ip/ip.h:246,2491997/0423/sys/src/9/ip/ip.h:274,277
1997/0327    
 * ipaux.c 
 */ 
int	myetheraddr(uchar*, char*); 
ulong	parseip(char*, char*); 
1997/0423    
ulong	parseip(uchar*, char*); 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)