home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / bootpd-2.zip / DHCP.PAT < prev    next >
Text File  |  1995-09-04  |  20KB  |  754 lines

  1. diff -rc bootp-2.4.2/Announce bootp-2.4.3/Announce
  2. *** bootp-2.4.2/Announce    Thu Feb 16 21:18:17 1995
  3. --- bootp-2.4.3/Announce    Thu Mar 16 08:58:23 1995
  4. ***************
  5. *** 6,11 ****
  6. --- 6,13 ----
  7.   
  8.   New features in version 2.4 include:
  9.   
  10. +     Added static DHCP allocation capabilities.
  11. +         Use: :dl=leasetime for DHCP leasetime handouts
  12.       Added a simple BOOTP gateway program: bootpgw
  13.       Allow host name anywhere IP address is expected.
  14.       Automatically lookup the IP address when the name of a
  15. ***************
  16. *** 49,60 ****
  17.       SunOS 4.X (Solaris 1.X)
  18.       SunOS 5.X (Solaris 2.X)
  19.       System V/386 Rel. 4.0
  20.   
  21.   Systems on which others say this code works:
  22.       CDC EP/IX (1.4.3, 2.1.1)
  23.       DEC Ultrix (4.2, 4.3)
  24. -     Linux 1.1.81
  25.       OSF/1 (DEC Alpha CPU)
  26.   
  27.   Please direct questions, comments, and bug reports to:
  28.       <bootp@andrew.cmu.edu>
  29. --- 51,69 ----
  30.       SunOS 4.X (Solaris 1.X)
  31.       SunOS 5.X (Solaris 2.X)
  32.       System V/386 Rel. 4.0
  33. +     Linux 1.1.81
  34.   
  35.   Systems on which others say this code works:
  36.       CDC EP/IX (1.4.3, 2.1.1)
  37.       DEC Ultrix (4.2, 4.3)
  38.       OSF/1 (DEC Alpha CPU)
  39. +     HP 9000
  40. + How to get the latest version:
  41. +     ftp firewall.mc.com (anonymous)
  42. +     cd /pub
  43. +     binary
  44. +     get bootp-2.4.2.tar.Z
  45.   
  46.   Please direct questions, comments, and bug reports to:
  47.       <bootp@andrew.cmu.edu>
  48. diff -rc bootp-2.4.2/Changes bootp-2.4.3/Changes
  49. *** bootp-2.4.2/Changes    Thu Feb 16 17:52:06 1995
  50. --- bootp-2.4.3/Changes    Thu Mar 16 08:24:18 1995
  51. ***************
  52. *** 2,13 ****
  53. --- 2,28 ----
  54.   Date, <email> Real Name
  55.       what...
  56.   
  57. + --> bootp-2.4.3
  58. + 08/07/95  middelin@polyware.iaf.nl (Pauline Middelink)
  59. +     Fixed problem while reporting duplicate hardware address in
  60. +     readfile.c (kerry@maine.maine.edu)
  61. +     Changed some code to allow the giaddr to pass through. Needed
  62. +     when the client request is forwarded to us through a gateway.
  63. +     (Broadcasting to the gateway will not reach the client)
  64. +     
  65. + 01/26/95  Phil.Packer@bbc.co.uk (Phil.Packer)
  66. +     Added dl tag for DHCP lease and rejigged Pauline's codes
  67. +     at the end of bootpd.c to allow the setting of explicit leases.
  68. +     Added "sco" Makefile target.
  69. +     
  70.   --> bootp-2.4.2
  71.   
  72.   01/14/95  middelin@polyware.iaf.nl (Pauline Middelink)
  73.       Corrected support for the Linux networking code.
  74.       Fixed lots of warnings (gcc -Wall)
  75.       Added "linux" Makefile target.
  76. +     Written code for DHCP static IP allocation.
  77.   
  78.   01/02/95  Jukka Ukkonen <ukkonen@csc.fi>
  79.       Allow bootptab syntax: ha="0:0:c0:80:e8:a7"
  80. diff -rc bootp-2.4.2/Makefile bootp-2.4.3/Makefile
  81. *** bootp-2.4.2/Makefile    Thu Feb 16 16:25:19 1995
  82. --- bootp-2.4.3/Makefile    Thu Mar 16 08:52:30 1995
  83. ***************
  84. *** 9,15 ****
  85.   # OPTion DEFinitions:
  86.   # Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
  87.   # in addition to the RFC1048 format.  Leaving out DEBUG saves little.
  88. ! OPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG
  89.   
  90.   # Uncomment and edit this to choose the facility code used for syslog.
  91.   # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
  92. --- 9,16 ----
  93.   # OPTion DEFinitions:
  94.   # Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
  95.   # in addition to the RFC1048 format.  Leaving out DEBUG saves little.
  96. ! # Remove the -DDHCP if you don't need DHCP support.
  97. ! OPTDEFS= -DSYSLOG -DVEND_CMU -DDHCP -DDEBUG
  98.   
  99.   # Uncomment and edit this to choose the facility code used for syslog.
  100.   # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
  101. ***************
  102. *** 37,43 ****
  103.   
  104.   INSTALL=/usr/bin/install
  105.   DESTDIR=
  106. ! BINDIR=/usr/etc
  107.   MANDIR=/usr/local/man
  108.   
  109.   CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
  110. --- 38,44 ----
  111.   
  112.   INSTALL=/usr/bin/install
  113.   DESTDIR=
  114. ! BINDIR=/usr/sbin
  115.   MANDIR=/usr/local/man
  116.   
  117.   CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
  118. ***************
  119. *** 95,103 ****
  120.           SYSDEFS="-DSVR4" \
  121.           SYSLIBS="-lsocket -lnsl"
  122.   
  123. ! # Linux 1.1.80+ on [34]86
  124.   linux:
  125. !     $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer"
  126.   
  127.   # SunOS 4.X
  128.   sunos4:
  129. --- 96,111 ----
  130.           SYSDEFS="-DSVR4" \
  131.           SYSLIBS="-lsocket -lnsl"
  132.   
  133. ! # Linux 1.1.80+
  134.   linux:
  135. !     $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer" \
  136. !         SYSLIBS="" \
  137. !         FILEDEFS='-DCONFIG_FILE=\"/etc/bootptab\" \
  138. !               -DDUMPTAB_FILE=\"/tmp/bootpd.dump\"'
  139. ! # SCO (pah!) SYSV rel 3.2
  140. ! sco:
  141. !     $(MAKE) CC="cc" SYSLIBS="-lsocket"
  142.   
  143.   # SunOS 4.X
  144.   sunos4:
  145. diff -rc bootp-2.4.2/bootp.h bootp-2.4.3/bootp.h
  146. *** bootp-2.4.2/bootp.h    Mon Aug 22 18:49:17 1994
  147. --- bootp-2.4.3/bootp.h    Thu Mar 16 08:17:22 1995
  148. ***************
  149. *** 122,129 ****
  150.   #define TAG_NIS_SERVER        ((unsigned char)  41)
  151.   #define TAG_NTP_SERVER        ((unsigned char)  42)
  152.   /* DHCP maximum message size. */
  153.   #define TAG_MAX_MSGSZ        ((unsigned char)  57)
  154.   /* XXX - Add new tags here */
  155.   
  156.   
  157. --- 122,133 ----
  158.   #define TAG_NIS_SERVER        ((unsigned char)  41)
  159.   #define TAG_NTP_SERVER        ((unsigned char)  42)
  160.   /* DHCP maximum message size. */
  161. + #define TAG_DHCP_IPLEASE    ((unsigned char)  51)
  162. + #define TAG_DHCP_MSG           ((unsigned char)  53)
  163. + #define TAG_DHCP_SERVERID    ((unsigned char)  54)
  164.   #define TAG_MAX_MSGSZ        ((unsigned char)  57)
  165. ! #define TAG_DHCP_IPRENEW    ((unsigned char)  58)    /* PeP hic facet */
  166. ! #define TAG_DHCP_IPREBIND    ((unsigned char)  59)
  167.   /* XXX - Add new tags here */
  168.   
  169.   
  170. diff -rc bootp-2.4.2/bootpd.c bootp-2.4.3/bootpd.c
  171. *** bootp-2.4.2/bootpd.c    Wed Feb 15 22:21:58 1995
  172. --- bootp-2.4.3/bootpd.c    Thu Mar 16 08:31:12 1995
  173. ***************
  174. *** 76,81 ****
  175. --- 76,90 ----
  176.   # define bzero(p,l)      memset(p,0,l)
  177.   # define bcmp(a,b,c)     memcmp(a,b,c)
  178.   #endif
  179. + #ifdef __linux__
  180. + /* Use sigaction to make signal last... */
  181. + inline void (*signal(int sig,void (*handler)(int)))(int) {
  182. +     struct sigaction so,sa = {NULL,0,SA_NOMASK|SA_RESTART,NULL};
  183. +     sa.sa_handler = handler;
  184. +     if (sigaction(sig,&sa,&so)<0) return NULL;
  185. +     return so.sa_handler;
  186. + }
  187. + #endif
  188.   
  189.   #include "bootp.h"
  190.   #include "hash.h"
  191. ***************
  192. *** 114,125 ****
  193.   #ifdef VEND_CMU
  194.   PRIVATE void dovend_cmu P((struct bootp *, struct host *));
  195.   #endif
  196. ! PRIVATE void dovend_rfc1048 P((struct bootp *, struct host *, int32));
  197.   PRIVATE void handle_reply P((void));
  198.   PRIVATE void handle_request P((void));
  199.   PRIVATE void sendreply P((int forward, int32 dest_override));
  200.   PRIVATE void usage P((void));
  201.   
  202.   #undef    P
  203.   
  204.   /*
  205. --- 123,144 ----
  206.   #ifdef VEND_CMU
  207.   PRIVATE void dovend_cmu P((struct bootp *, struct host *));
  208.   #endif
  209. ! PRIVATE int  dovend_rfc1048 P((struct bootp *, struct host *, int32));
  210.   PRIVATE void handle_reply P((void));
  211.   PRIVATE void handle_request P((void));
  212.   PRIVATE void sendreply P((int forward, int32 dest_override));
  213.   PRIVATE void usage P((void));
  214.   
  215. + #ifdef DHCP
  216. + PRIVATE int dhcp_discover P((struct bootp *, struct host *, byte *, int));
  217. + PRIVATE int dhcp_request P((struct bootp *, struct host *, byte *, int));
  218. + PRIVATE int dhcp_decline P((struct bootp *, struct host *, byte *, int));
  219. + PRIVATE int dhcp_release P((struct bootp *, struct host *, byte *, int));
  220. + PRIVATE int dhcp_offer P((struct bootp *, struct host *, byte *, int));
  221. + PRIVATE int dhcp_ack P((struct bootp *, struct host *, byte *, int));
  222. + PRIVATE int dhcp_lease P((struct bootp *, struct host *, byte **));
  223. + #endif
  224.   #undef    P
  225.   
  226.   /*
  227. ***************
  228. *** 477,482 ****
  229. --- 496,512 ----
  230.           bootpc_port = (u_short) IPPORT_BOOTPC;
  231.       }
  232.   
  233. + #ifdef DHCP
  234. +     /*
  235. +      * Maybe we have to broadcast, so enable it.
  236. +      */
  237. +     n = 1;
  238. +     if (setsockopt(s,SOL_SOCKET,SO_BROADCAST,&n,sizeof(n))<0) {
  239. +         report(LOG_ERR, "setsockopt: %s\n", get_errmsg());
  240. +         exit(1);
  241. +     }
  242. + #endif
  243.       /*
  244.        * Set up signals to read or dump the table.
  245.        */
  246. ***************
  247. *** 701,707 ****
  248.                          haddrtoa(bp->bp_chaddr, bp->bp_hlen));
  249.               return; /* not found */
  250.           }
  251. -         (bp->bp_yiaddr).s_addr = hp->iaddr.s_addr;
  252.   
  253.       } else {
  254.   
  255. --- 731,736 ----
  256. ***************
  257. *** 724,729 ****
  258. --- 753,759 ----
  259.               return;
  260.           }
  261.       }
  262. +     (bp->bp_yiaddr).s_addr = hp->iaddr.s_addr;
  263.   
  264.       if (debug) {
  265.           report(LOG_INFO, "found %s (%s)", inet_ntoa(hp->iaddr),
  266. ***************
  267. *** 961,967 ****
  268.        */
  269.       if (!bcmp(bp->bp_vend, vm_rfc1048, 4)) {
  270.           /* RFC1048 conformant bootp client */
  271. !         dovend_rfc1048(bp, hp, bootsize);
  272.           if (debug > 1) {
  273.               report(LOG_INFO, "sending reply (with RFC1048 options)");
  274.           }
  275. --- 991,998 ----
  276.        */
  277.       if (!bcmp(bp->bp_vend, vm_rfc1048, 4)) {
  278.           /* RFC1048 conformant bootp client */
  279. !         if (!dovend_rfc1048(bp, hp, bootsize))
  280. !             return;
  281.           if (debug > 1) {
  282.               report(LOG_INFO, "sending reply (with RFC1048 options)");
  283.           }
  284. ***************
  285. *** 1093,1098 ****
  286. --- 1124,1137 ----
  287.           /* Finally, set the server address field. */
  288.           bp->bp_siaddr = siaddr;
  289.       }
  290. + #ifdef DHCP
  291. +     /*
  292. +      * This code is placed here, because otherwise the siaddr
  293. +      * will not be found...
  294. +      */
  295. +     if (ntohs(bp->bp_flags) & 0x8000 && bp->bp_giaddr.s_addr==0)
  296. +         dst.s_addr = INADDR_BROADCAST;
  297. + #endif
  298.       /* Set up socket address for send. */
  299.       send_addr.sin_family = AF_INET;
  300.       send_addr.sin_port = htons(port);
  301. ***************
  302. *** 1220,1228 ****
  303.       if (bytesleft < (LEN)) { \
  304.           report(LOG_NOTICE, noroom, \
  305.                  hp->hostname->string, MSG); \
  306. !         return; \
  307.       } while (0)
  308. ! PRIVATE void
  309.   dovend_rfc1048(bp, hp, bootsize)
  310.       struct bootp *bp;
  311.       struct host *hp;
  312. --- 1259,1267 ----
  313.       if (bytesleft < (LEN)) { \
  314.           report(LOG_NOTICE, noroom, \
  315.                  hp->hostname->string, MSG); \
  316. !         return 0; \
  317.       } while (0)
  318. ! PRIVATE int
  319.   dovend_rfc1048(bp, hp, bootsize)
  320.       struct bootp *bp;
  321.       struct host *hp;
  322. ***************
  323. *** 1230,1235 ****
  324. --- 1269,1278 ----
  325.   {
  326.       int bytesleft, len;
  327.       byte *vp;
  328. + #ifdef DHCP
  329. +     int dhcp = 0;
  330. +     int isme = TRUE;    /* DHCP uses this for not-mine-requests */
  331. + #endif
  332.   
  333.       static char noroom[] = "%s: No room for \"%s\" option";
  334.   
  335. ***************
  336. *** 1280,1286 ****
  337.                   case TAG_SUBNET_MASK:
  338.                       /* XXX - Should preserve this if given... */
  339.                       break;
  340. !                 } /* swtich */
  341.                   p += len;
  342.               }
  343.   
  344. --- 1323,1335 ----
  345.                   case TAG_SUBNET_MASK:
  346.                       /* XXX - Should preserve this if given... */
  347.                       break;
  348. !                 case TAG_DHCP_MSG:
  349. !                     dhcp = *p;
  350. !                     break;
  351. !                 case TAG_DHCP_SERVERID:
  352. !                     isme = (len==4) && my_ip_addr.s_addr == ((struct in_addr *)p)->s_addr;
  353. !                     break;
  354. !                 } /* switch */
  355.                   p += len;
  356.               }
  357.   
  358. ***************
  359. *** 1347,1362 ****
  360.           vp += len;
  361.           *vp++ = TAG_END;
  362.           bytesleft -= len + 3;
  363. !         return;                    /* no more options here. */
  364.       }
  365.       /*
  366. !      * The remaining options are inserted by the following
  367. !      * function (which is shared with bootpef.c).
  368. !      * Keep back one byte for the TAG_END.
  369.        */
  370. !     len = dovend_rfc1497(hp, vp, bytesleft - 1);
  371. !     vp += len;
  372. !     bytesleft -= len;
  373.   
  374.       /* There should be at least one byte left. */
  375.       NEED(1, "(end)");
  376. --- 1396,1439 ----
  377.           vp += len;
  378.           *vp++ = TAG_END;
  379.           bytesleft -= len + 3;
  380. !         return 1;                /* no more options here. */
  381.       }
  382. + #ifdef DHCP
  383.       /*
  384. !      * Check if this is a DHCP request.
  385.        */
  386. !     if (dhcp!=0) {
  387. !         if (!isme)
  388. !             return 0;    /* Not mine, discard! */
  389. !         switch (dhcp) {
  390. !          case 1 : len = dhcp_discover(bp,hp,vp,bytesleft-1); break;
  391. !          case 3 : len = dhcp_request(bp,hp,vp,bytesleft-1); break;
  392. !          case 4 : len = dhcp_decline(bp,hp,vp,bytesleft-1); break;
  393. !          case 7 : len = dhcp_release(bp,hp,vp,bytesleft-1); break;
  394. !          default : report(LOG_NOTICE,"Unknown DHCP request (%d)",dhcp);
  395. !                return 0;
  396. !         }
  397. !         /* Is there a DHCP reply at all? */
  398. !         if (len==0)
  399. !             return 0;
  400. !         vp += len;
  401. !         bytesleft -= len;
  402. !     }
  403. !     else {
  404. ! #endif
  405. !         /*
  406. !          * The remaining options are inserted by the following
  407. !          * function (which is shared with bootpef.c).
  408. !          * Keep back one byte for the TAG_END.
  409. !          */
  410. !         len = dovend_rfc1497(hp, vp, bytesleft - 1);
  411. !         vp += len;
  412. !         bytesleft -= len;
  413. ! #ifdef DHCP
  414. !     }
  415. ! #endif
  416.   
  417.       /* There should be at least one byte left. */
  418.       NEED(1, "(end)");
  419. ***************
  420. *** 1370,1375 ****
  421. --- 1447,1453 ----
  422.            */
  423.           bzero(vp, bytesleft);
  424.       }
  425. +     return 1;    /* sent reply */
  426.   } /* dovend_rfc1048 */
  427.   #undef    NEED
  428.   
  429. ***************
  430. *** 1389,1394 ****
  431. --- 1467,1637 ----
  432.    */
  433.   
  434.   /* get_errmsg() - now in report.c */
  435. + #ifdef DHCP
  436. + /*
  437. +  * PeP hic facet
  438. +  * Stuff the packet with the Lease info, We need to do this on the Offer and
  439. +  * the ack so separated out here
  440. +  */
  441. + PRIVATE
  442. + int dhcp_lease(bp, hp, vp)
  443. +     struct bootp *bp;
  444. +     struct host *hp;
  445. +     byte **vp;
  446. + {
  447. +     *(*vp)++ = TAG_DHCP_IPRENEW;    /* DHCP Renewal time 50% of lease */
  448. +     *(*vp)++ = 4;            /* Length */
  449. +     insert_u_long(htonl(hp->dhcp_lease/2),vp);
  450. +     *(*vp)++ = TAG_DHCP_IPREBIND;    /* DHCP Rebinding time 85% of lease */
  451. +     *(*vp)++ = 4;
  452. +     insert_u_long(htonl(hp->dhcp_lease*7/8),vp);
  453. +     
  454. +     *(*vp)++ = TAG_DHCP_IPLEASE;    /* IP address lease time */
  455. +     *(*vp)++ = 4;            /* Length */
  456. +     insert_u_long(htonl(hp->dhcp_lease),vp); /* PeP hic facet, lets see if this works */
  457. +     return(19);
  458. + }
  459. + /*
  460. +  * Formulate an DHCP_DISCOVER reply
  461. +  */
  462. + PRIVATE
  463. + int dhcp_discover(bp, hp, vp, bytesleft)
  464. +     struct bootp *bp;
  465. +     struct host *hp;
  466. +     byte *vp;
  467. +     int bytesleft;
  468. + {
  469. +     if(debug)
  470. +         report(LOG_INFO, "Received: DHCPDISCOVER");
  471. +     return(dhcp_offer(bp,hp,vp,bytesleft));
  472. + }
  473. + /*
  474. +  * formulate an DHCP_RELEASE reply
  475. +  */
  476. + PRIVATE
  477. + int dhcp_release(bp, hp, vp, bytesleft)
  478. +     struct bootp *bp;
  479. +     struct host *hp;
  480. +     byte *vp;
  481. +     int bytesleft;
  482. + {
  483. +     if (debug)
  484. +         report(LOG_INFO, "Received: DHCPRELEASE (discarded)");
  485. +     return 0;
  486. + }
  487. + PRIVATE
  488. + int dhcp_offer(bp, hp, vp, bytesleft)
  489. +     struct bootp *bp;
  490. +     struct host *hp;
  491. +     byte *vp;
  492. +     int bytesleft;
  493. + {
  494. +     int len=0;
  495. +     if (debug)
  496. +         report(LOG_INFO, "Sent: DHCPOFFER");
  497. +     bp->bp_secs = bp->bp_hops = 0;
  498. +     bp->bp_ciaddr.s_addr = 0;
  499. +     *vp++ = TAG_DHCP_MSG;        /* DHCP */
  500. +     *vp++ = 1;            /* length */
  501. +     *vp++ = 2;            /* DHCPOFFER */
  502. +     len +=  3;    
  503. +     len += dhcp_lease(bp,hp,&vp);
  504. +     *vp++ = TAG_DHCP_SERVERID;
  505. +     *vp++ = 4;
  506. +     insert_u_long(my_ip_addr.s_addr,&vp);
  507. +     len += 6;
  508. +     return len + dovend_rfc1497(hp, vp, bytesleft - len);
  509. + }
  510. + /*
  511. +  * Formulate an DHCP_REQUEST reply
  512. +  */
  513. + PRIVATE
  514. + int dhcp_request(bp, hp, vp, bytesleft)
  515. +     struct bootp *bp;
  516. +     struct host *hp;
  517. +     byte *vp;
  518. +     int bytesleft;
  519. + {
  520. +     bp->bp_secs = bp->bp_hops = 0;
  521. +     if(debug)
  522. +         report(LOG_INFO,"Received: DHCPREQUEST");
  523. +     /*
  524. +      * Make absolutely sure that if the client requests an address,
  525. +      * it is its own address, and also make sure the hardware
  526. +      * addresses match perfectly. We want to minimize spoofing!
  527. +      */
  528. +     if ((bp->bp_ciaddr.s_addr && bp->bp_ciaddr.s_addr!=bp->bp_yiaddr.s_addr) ||
  529. +         bp->bp_htype != hp->htype ||
  530. +             bcmp(bp->bp_chaddr, hp->haddr, haddrlength(hp->htype))) {
  531. +         if (debug)
  532. +             report(LOG_INFO, "Sent: DHCPNAK");
  533. +         *vp++ = TAG_DHCP_MSG;    /* DHCPNAK */
  534. +         *vp++ = 1;
  535. +         *vp++ = 6;
  536. +         return 3;
  537. +     }
  538. +     else 
  539. +         return(dhcp_ack(bp,hp,vp,bytesleft));    
  540. + }
  541. + PRIVATE
  542. + int dhcp_ack(bp, hp, vp, bytesleft)
  543. +     struct bootp *bp;
  544. +     struct host *hp;
  545. +     byte *vp;
  546. +     int bytesleft;
  547. + {
  548. +     int len=0;
  549. +     if (debug)
  550. +         report(LOG_INFO, "Sent: DHCPACK");
  551. +     *vp++ = TAG_DHCP_MSG;    /* DHCPACK */
  552. +     *vp++ = 1;
  553. +     *vp++ = 5;
  554. +     len += 3;
  555. +     len += dhcp_lease(bp,hp,&vp);
  556. +     *vp++ = TAG_DHCP_SERVERID;    /* Server id */
  557. +     *vp++ = 4;
  558. +     insert_u_long(my_ip_addr.s_addr,&vp);
  559. +     len += 6;
  560. +     return len + dovend_rfc1497(hp, vp, bytesleft - len);
  561. + }
  562. + /*
  563. +  * formulate an DHCP_DECLINE reply
  564. +  */
  565. + PRIVATE
  566. + int dhcp_decline(bp, hp, vp, bytesleft)
  567. +     struct bootp *bp;
  568. +     struct host *hp;
  569. +     byte *vp;
  570. +     int bytesleft;
  571. + {
  572. +     if (debug)
  573. +         report(LOG_INFO, "Recived: DHCPDECLINE (ignored)");
  574. +     return 0;
  575. + }
  576. + #endif
  577.   
  578.   /*
  579.    * Local Variables:
  580. diff -rc bootp-2.4.2/bootpd.h bootp-2.4.3/bootpd.h
  581. *** bootp-2.4.2/bootpd.h    Thu Jul 28 00:30:29 1994
  582. --- bootp-2.4.3/bootpd.h    Thu Mar 16 08:17:23 1995
  583. ***************
  584. *** 126,131 ****
  585. --- 126,134 ----
  586.           exec_file    :1,
  587.           msg_size    :1,
  588.           min_wait    :1,
  589. + #ifdef DHCP
  590. +         dhcp_lease    :1,    /* PeP hic facet */
  591. + #endif
  592.           /* XXX - Add new tags here */
  593.           vm_cookie    :1;
  594.   };
  595. ***************
  596. *** 184,189 ****
  597. --- 187,195 ----
  598.       unsigned int32        bootsize,
  599.                   msg_size,
  600.                   min_wait;
  601. + #ifdef DHCP
  602. +     unsigned int32        dhcp_lease; /* PeP hic facet */
  603. + #endif
  604.       struct in_addr        bootserver,
  605.                   iaddr,
  606.                   swap_server,
  607. diff -rc bootp-2.4.2/bootptest.c bootp-2.4.3/bootptest.c
  608. *** bootp-2.4.2/bootptest.c    Thu Feb 16 16:36:25 1995
  609. --- bootp-2.4.3/bootptest.c    Thu Mar 16 08:17:36 1995
  610. ***************
  611. *** 50,55 ****
  612. --- 50,58 ----
  613.   #include <unistd.h>
  614.   #endif
  615.   
  616. + #ifndef    NO_UNISTD
  617. + #include <unistd.h>
  618. + #endif
  619.   #include <stdlib.h>
  620.   #include <signal.h>
  621.   #include <stdio.h>
  622. ***************
  623. *** 66,71 ****
  624. --- 69,77 ----
  625.   
  626.   #include "patchlevel.h"
  627.   
  628. + static void send_request();
  629. + extern int getether();
  630.   static void send_request();
  631.   
  632.   #define LOG_ERR 1
  633. diff -rc bootp-2.4.2/print-bootp.c bootp-2.4.3/print-bootp.c
  634. *** bootp-2.4.2/print-bootp.c    Wed Feb 15 23:21:13 1995
  635. --- bootp-2.4.3/print-bootp.c    Thu Mar 16 08:41:15 1995
  636. ***************
  637. *** 268,274 ****
  638.       "iXW-FS",            /* 48: X Window System Font Servers */
  639.       "iXW-DM",            /* 49: X Window System Display Managers */
  640.   
  641. !     /* DHCP extensions (RFC-1533, sect. 9) */
  642.   #endif
  643.   };
  644.   #define    KNOWN_OPTIONS (sizeof(rfc1048_opts) / sizeof(rfc1048_opts[0]))
  645. --- 268,279 ----
  646.       "iXW-FS",            /* 48: X Window System Font Servers */
  647.       "iXW-DM",            /* 49: X Window System Display Managers */
  648.   
  649. !     /* DHCP extensions (RFC-1533, sect. 9) PeP hic facet */
  650. !     "iDHCPreq",            /* 50: DHCP requested IP address */
  651. !     "lDHCPlease",            /* 51: DHCP lease time */ 
  652. !     "bDHCPooptol",            /* 52: DHCP option overload */
  653. !     "bDHCPtype",            /* 53: DHCP message type */
  654. !     "iDHCPSid",            /* 54: DHCP server ID */
  655.   #endif
  656.   };
  657.   #define    KNOWN_OPTIONS (sizeof(rfc1048_opts) / sizeof(rfc1048_opts[0]))
  658. diff -rc bootp-2.4.2/readfile.c bootp-2.4.3/readfile.c
  659. *** bootp-2.4.2/readfile.c    Wed Feb 15 21:45:25 1995
  660. --- bootp-2.4.3/readfile.c    Thu Mar 16 08:46:17 1995
  661. ***************
  662. *** 113,118 ****
  663. --- 113,121 ----
  664.   #define SYM_EXEC_FILE         33    /* YORK_EX_OPTION */
  665.   #define SYM_MSG_SIZE          34
  666.   #define SYM_MIN_WAIT         35
  667. + #define SYM_DHCP_LEASE         36    /* RFC 1533 PeP hic facet */
  668. + #define SYM_DHCP_IPRENEW     37
  669. + #define SYM_DHCP_IPREBIND     38
  670.   /* XXX - Add new tags here */
  671.   
  672.   #define OP_ADDITION          1    /* Operations on tags */
  673. ***************
  674. *** 161,166 ****
  675. --- 164,172 ----
  676.       {"df", SYM_DUMP_FILE},
  677.       {"dn", SYM_DOMAIN_NAME},
  678.       {"ds", SYM_DOMAIN_SERVER},
  679. + #ifdef DHCP
  680. +     {"dl", SYM_DHCP_LEASE},        /* PeP hic facet */
  681. + #endif
  682.       {"ef", SYM_EXTEN_FILE},
  683.       {"ex", SYM_EXEC_FILE},        /* YORK_EX_OPTION */
  684.       {"gw", SYM_GATEWAY},
  685. ***************
  686. *** 1125,1131 ****
  687.           PARSE_UINT(min_wait);
  688.           break;
  689.   
  690. !         /* XXX - Add new tags here */
  691.   
  692.       default:
  693.           return E_UNKNOWN_SYMBOL;
  694. --- 1131,1146 ----
  695.           PARSE_UINT(min_wait);
  696.           break;
  697.   
  698. ! #ifdef DHCP        
  699. !     /* PeP hic facet. */            
  700. !     case SYM_DHCP_LEASE:
  701. !         PARSE_UINT(dhcp_lease);
  702. !         break;
  703. !         /* XXX - Add new DHCP tags here */
  704. ! #endif
  705. !     /* XXX - Add new tags here */
  706.   
  707.       default:
  708.           return E_UNKNOWN_SYMBOL;
  709. ***************
  710. *** 1506,1511 ****
  711. --- 1521,1527 ----
  712.       DUP_COPY(min_wait);
  713.   
  714.       /* XXX - Add new tags here */
  715. +     DUP_COPY(dhcp_lease); /* PeP hic facet */
  716.   
  717.       DUP_LINK(generic);
  718.   
  719.  
  720.