changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: snoopy(8): include dhcp.h instead of replicating bootp/dhcp options enum

changeset 7264: 2a3c4f34c585
parent 7263: b703b47e2940
child 7265: ff77c8e6d1a0
author: Alex Musolino <alex@musolino.id.au>
date: Tue, 11 Jun 2019 15:18:27 +0930
files: sys/src/cmd/ip/snoopy/dhcp.c
description: snoopy(8): include dhcp.h instead of replicating bootp/dhcp options enum
     1.1--- a/sys/src/cmd/ip/snoopy/dhcp.c
     1.2+++ b/sys/src/cmd/ip/snoopy/dhcp.c
     1.3@@ -3,105 +3,7 @@
     1.4 #include <ip.h>
     1.5 #include "dat.h"
     1.6 #include "protos.h"
     1.7-
     1.8-enum
     1.9-{
    1.10-	Maxoptlen=	312-4,
    1.11-
    1.12-	/* dhcp types */
    1.13-	Discover=	1,
    1.14-	Offer=		2,
    1.15-	Request=	3,
    1.16-	Decline=	4,
    1.17-	Ack=		5,
    1.18-	Nak=		6,
    1.19-	Release=	7,
    1.20-	Inform=		8,
    1.21-
    1.22-	/* bootp option types */
    1.23-	OBend=			255,
    1.24-	OBpad=			0,
    1.25-	OBmask=			1,
    1.26-	OBtimeoff=		2,
    1.27-	OBrouter=		3,
    1.28-	OBtimeserver=		4,
    1.29-	OBnameserver=		5,
    1.30-	OBdnserver=		6,
    1.31-	OBlogserver=		7,
    1.32-	OBcookieserver=		8,
    1.33-	OBlprserver=		9,
    1.34-	OBimpressserver=	10,
    1.35-	OBrlserver=		11,
    1.36-	OBhostname=		12,	/* 0xc0 */
    1.37-	OBbflen=		13,
    1.38-	OBdumpfile=		14,
    1.39-	OBdomainname=		15,
    1.40-	OBswapserver=		16,	/* 0x10 */
    1.41-	OBrootpath=		17,
    1.42-	OBextpath=		18,
    1.43-	OBipforward=		19,
    1.44-	OBnonlocal=		20,
    1.45-	OBpolicyfilter=		21,
    1.46-	OBmaxdatagram=		22,
    1.47-	OBttl=			23,
    1.48-	OBpathtimeout=		24,
    1.49-	OBpathplateau=		25,
    1.50-	OBmtu=			26,
    1.51-	OBsubnetslocal=		27,
    1.52-	OBbaddr=		28,
    1.53-	OBdiscovermask=		29,
    1.54-	OBsupplymask=		30,
    1.55-	OBdiscoverrouter=	31,
    1.56-	OBrsserver=		32,	/* 0x20 */
    1.57-	OBstaticroutes=		33,
    1.58-	OBtrailerencap=		34,
    1.59-	OBarptimeout=		35,
    1.60-	OBetherencap=		36,
    1.61-	OBtcpttl=		37,
    1.62-	OBtcpka=		38,
    1.63-	OBtcpkag=		39,
    1.64-	OBnisdomain=		40,
    1.65-	OBniserver=		41,
    1.66-	OBntpserver=		42,
    1.67-	OBvendorinfo=		43,	/* 0x2b */
    1.68-	OBnetbiosns=		44,
    1.69-	OBnetbiosdds=		45,
    1.70-	OBnetbiostype=		46,
    1.71-	OBnetbiosscope=		47,
    1.72-	OBxfontserver=		48,	/* 0x30 */
    1.73-	OBxdispmanager=		49,
    1.74-	OBnisplusdomain=	64,	/* 0x40 */
    1.75-	OBnisplusserver=	65,
    1.76-	OBhomeagent=		68,
    1.77-	OBsmtpserver=		69,
    1.78-	OBpop3server=		70,
    1.79-	OBnntpserver=		71,
    1.80-	OBwwwserver=		72,
    1.81-	OBfingerserver=		73,
    1.82-	OBircserver=		74,
    1.83-	OBstserver=		75,
    1.84-	OBstdaserver=		76,
    1.85-
    1.86-	/* dhcp options */
    1.87-	ODipaddr=		50,	/* 0x32 */
    1.88-	ODlease=		51,
    1.89-	ODoverload=		52,
    1.90-	ODtype=			53,	/* 0x35 */
    1.91-	ODserverid=		54,	/* 0x36 */
    1.92-	ODparams=		55,	/* 0x37 */
    1.93-	ODmessage=		56,
    1.94-	ODmaxmsg=		57,
    1.95-	ODrenewaltime=		58,
    1.96-	ODrebindingtime=	59,
    1.97-	ODvendorclass=		60,
    1.98-	ODclientid=		61,	/* 0x3d */
    1.99-	ODtftpserver=		66,
   1.100-	ODbootfile=		67,
   1.101-
   1.102-	/* plan9 vendor info options */
   1.103-	OP9fsv4=		128,	/* plan9 file servers */
   1.104-	OP9authv4=		129,	/* plan9 auth servers */
   1.105-};
   1.106+#include "../dhcp.h"
   1.107 
   1.108 /*
   1.109  *  convert a byte array to hex
   1.110@@ -305,8 +207,8 @@ p_seprint(Msg *m)
   1.111 		case OBdomainname:
   1.112 			p = pstring(p, e, "domname", o, n);
   1.113 			break;
   1.114-		case OBswapserver:
   1.115-			p = pserver(p, e, "swapsrv", o, n);
   1.116+		case OBrootserver:
   1.117+			p = pserver(p, e, "rootsrv", o, n);
   1.118 			break;
   1.119 		case OBrootpath:
   1.120 			p = pstring(p, e, "rootpath", o, n);