home *** CD-ROM | disk | FTP | other *** search
/ ftp.mayn.de / ftp.mayn.de-pub.zip / ftp.mayn.de-pub / apple / apple_unix / Daemons / gated-2.1.aux.patches < prev    next >
Text File  |  2017-03-06  |  12KB  |  458 lines

  1. The following patches update gated version 2.1 (Patch Level 3)
  2. for A/UX version 2.01.  By herbw@wiskit.rain.com (Herb Weiner)
  3.  
  4. *** Makefile.ORIGINAL    Sun Jun 13 17:06:19 1993
  5. --- Makefile    Sun Jun 13 17:06:19 1993
  6. ***************
  7. *** 15,21
  8.               src/compat/asm.sed src/compat/make
  9.   
  10.   ALTSRCFILES    =    src.alt/Makefile src.alt/*.[ch]\
  11. !             src.alt/{version,sigconv}.awk src/asm.sed
  12.   ROOTFILES    =    Acknowledgements CHANGES Copyright Licensing Makefile README
  13.   ROOTDIRS    =    aux conf man rfc
  14.   TARFILES    =    ${ROOTFILES} ${ROOTDIRS} ${SRCFILES}
  15.  
  16. --- 15,21 -----
  17.               src/compat/asm.sed src/compat/make
  18.   
  19.   ALTSRCFILES    =    src.alt/Makefile src.alt/*.[ch]\
  20. !             src.alt/version.awk src.alt/sigconv.awk src/asm.sed
  21.   ROOTFILES    =    Acknowledgements CHANGES Copyright Licensing Makefile README
  22.   ROOTDIRS    =    aux conf man rfc
  23.   TARFILES    =    ${ROOTFILES} ${ROOTDIRS} ${SRCFILES}
  24. *** src/Makefile.config.ORIGINAL    Sun Jun 13 17:07:09 1993
  25. --- src/Makefile.config    Sun Jun 13 17:07:10 1993
  26. ***************
  27. *** 9,15
  28.   #    Directory where gated and support programs will reside.  Usually
  29.   #    /etc (/usr/etc on SunOS 4.0).
  30.   #
  31. ! DESTDIR=/etc
  32.   
  33.   #
  34.   #    Include directories for NYSERnet's SNMP.
  35.  
  36. --- 9,15 -----
  37.   #    Directory where gated and support programs will reside.  Usually
  38.   #    /etc (/usr/etc on SunOS 4.0).
  39.   #
  40. ! DESTDIR=/usr/local/bin
  41.   
  42.   #
  43.   #    Include directories for NYSERnet's SNMP.
  44. ***************
  45. *** 14,20
  46.   #
  47.   #    Include directories for NYSERnet's SNMP.
  48.   #
  49. ! SNMP_INCLUDE=/usr/include/arpa/snmp
  50.   
  51.   #
  52.   #    Include file which defines all the signals, usually
  53.  
  54. --- 14,20 -----
  55.   #
  56.   #    Include directories for NYSERnet's SNMP.
  57.   #
  58. ! #SNMP_INCLUDE=/usr/include/arpa/snmp
  59.   
  60.   #
  61.   #    Include file which defines all the signals, usually
  62. ***************
  63. *** 30,36
  64.   #
  65.   #    Where to look for awk.  For BSD 4.3 Reno use /usr/bin/awk
  66.   #
  67. ! AWK=/bin/awk
  68.   
  69.   #
  70.   #    Compile time definitions.  These are defined in Makefile.gated
  71.  
  72. --- 30,36 -----
  73.   #
  74.   #    Where to look for awk.  For BSD 4.3 Reno use /usr/bin/awk
  75.   #
  76. ! AWK=/usr/bin/awk
  77.   
  78.   #
  79.   #    Compile time definitions.  These are defined in Makefile.gated
  80. ***************
  81. *** 35,41
  82.   #
  83.   #    Compile time definitions.  These are defined in Makefile.gated
  84.   #
  85. ! DFLAGS= -DSUNOS
  86.   
  87.   #
  88.   #    Where to find gated includes.
  89.  
  90. --- 35,42 -----
  91.   #
  92.   #    Compile time definitions.  These are defined in Makefile.gated
  93.   #
  94. ! #DFLAGS= -DSYSV -DGATEWAY
  95. ! DFLAGS= -DGATEWAY
  96.   
  97.   #
  98.   #    Where to find gated includes.
  99. ***************
  100. *** 65,71
  101.   #    nameserver and don't have the resolver routines in libc.  For AIX
  102.   #    3.1 you will need '-lm -lbsd'
  103.   #
  104. ! LDFLAGS=
  105.   
  106.   #
  107.   #    Flags for lint
  108.  
  109. --- 66,72 -----
  110.   #    nameserver and don't have the resolver routines in libc.  For AIX
  111.   #    3.1 you will need '-lm -lbsd'
  112.   #
  113. ! LDFLAGS=    -lbsd -lc_s
  114.   
  115.   #
  116.   #    Flags for lint
  117. ***************
  118. *** 100,106
  119.   #    Command to update the symbol table in a library.  Should be
  120.   #    'ranlib' on BSD.  AIX/PS2 requires ':'.
  121.   #
  122. ! RANLIB=    ranlib
  123.   
  124.   #
  125.   #    C compilation definitions.  On Vaxen the assembler output of the
  126.  
  127. --- 101,107 -----
  128.   #    Command to update the symbol table in a library.  Should be
  129.   #    'ranlib' on BSD.  AIX/PS2 requires ':'.
  130.   #
  131. ! RANLIB=    echo ranlib
  132.   
  133.   #
  134.   #    C compilation definitions.  On Vaxen the assembler output of the
  135. *** src/config.h.ORIGINAL    Sun Jun 13 17:07:09 1993
  136. --- src/config.h    Sun Jun 13 17:07:10 1993
  137. ***************
  138. *** 146,152
  139.   #ifdef    hpux
  140.   #define    UNIX_NAME "/hp-ux"
  141.   #endif                /* hp-ux */
  142. ! #if    defined(AIX) || defined(SYSV)
  143.   #define    UNIX_NAME "/unix"
  144.   #endif                /* AIX */
  145.   #ifndef    UNIX_NAME
  146.  
  147. --- 146,152 -----
  148.   #ifdef    hpux
  149.   #define    UNIX_NAME "/hp-ux"
  150.   #endif                /* hp-ux */
  151. ! #if    defined(AIX) || defined(SYSV) || defined(_AUX_SOURCE)
  152.   #define    UNIX_NAME "/unix"
  153.   #endif                /* AIX */
  154.   #ifndef    UNIX_NAME
  155. ***************
  156. *** 204,210
  157.   #endif
  158.   
  159.   /* Macros for System V compatability */
  160. ! #if    defined(SYSV) || defined(hpux)
  161.   #define    srandom    srand
  162.   #define    random    rand
  163.   #define    setlinebuf(x)    setvbuf(x, NULL, _IOLBF, BUFSIZ)
  164.  
  165. --- 204,210 -----
  166.   #endif
  167.   
  168.   /* Macros for System V compatability */
  169. ! #if    defined(SYSV) || defined(hpux) || defined (_AUX_SOURCE)
  170.   #define    srandom    srand
  171.   #define    random    rand
  172.   #define    setlinebuf(x)    setvbuf(x, NULL, _IOLBF, BUFSIZ)
  173. *** src/include.h.ORIGINAL    Sun Jun 13 17:07:09 1993
  174. --- src/include.h    Sun Jun 13 17:07:10 1993
  175. ***************
  176. *** 67,72
  177.    * System and EGP header files to be included.
  178.    */
  179.   
  180.   #ifdef    vax11c
  181.   #include "[.vms]gated_named.h"
  182.   #endif    /* vax11c */
  183.  
  184. --- 67,76 -----
  185.    * System and EGP header files to be included.
  186.    */
  187.   
  188. + #ifdef _AUX_SOURCE
  189. + #include <time.h>
  190. + #endif    /* _AUX_SOURCE */
  191.   #ifdef    vax11c
  192.   #include "[.vms]gated_named.h"
  193.   #endif    /* vax11c */
  194. *** src/krt.c.ORIGINAL    Sun Jun 13 17:07:10 1993
  195. --- src/krt.c    Sun Jun 13 17:07:10 1993
  196. ***************
  197. *** 70,77
  198.   #define ROUTE_KERNEL
  199.   #include "include.h"
  200.   #include <nlist.h>
  201. - #ifdef    SYSV
  202. - #include <sys/sioctl.h>
  203.   #include <sys/stropts.h>
  204.   #else    /* SYSV */
  205.   #include <sys/ioctl.h>
  206.  
  207. --- 70,75 -----
  208.   #define ROUTE_KERNEL
  209.   #include "include.h"
  210.   #include <nlist.h>
  211.   #include <sys/stropts.h>
  212.   #include <sys/ioctl.h>
  213.   #include <sys/mbuf.h>
  214. ***************
  215. *** 73,79
  216.   #ifdef    SYSV
  217.   #include <sys/sioctl.h>
  218.   #include <sys/stropts.h>
  219. - #else    /* SYSV */
  220.   #include <sys/ioctl.h>
  221.   #endif    /* SYSV */
  222.   #include <sys/mbuf.h>
  223.  
  224. --- 71,76 -----
  225.   #include "include.h"
  226.   #include <nlist.h>
  227.   #include <sys/stropts.h>
  228.   #include <sys/ioctl.h>
  229.   #include <sys/mbuf.h>
  230.   #ifndef vax11c
  231. ***************
  232. *** 75,81
  233.   #include <sys/stropts.h>
  234.   #else    /* SYSV */
  235.   #include <sys/ioctl.h>
  236. - #endif    /* SYSV */
  237.   #include <sys/mbuf.h>
  238.   #ifndef vax11c
  239.   #include <sys/file.h>
  240.  
  241. --- 72,77 -----
  242.   #include <nlist.h>
  243.   #include <sys/stropts.h>
  244.   #include <sys/ioctl.h>
  245.   #include <sys/mbuf.h>
  246.   #ifndef vax11c
  247.   #include <sys/file.h>
  248. ***************
  249. *** 169,174
  250.   #define krt_conv(ptr)    mtod(&ptr, struct rtentry *)
  251.   #endif                /* !defined(krt_next) && !defined(RTM_ADD) */
  252.   
  253.   
  254.    /*    Delete a route given dest, gateway and flags    */
  255.   /*ARGSUSED*/
  256.  
  257. --- 165,171 -----
  258.   #define krt_conv(ptr)    mtod(&ptr, struct rtentry *)
  259.   #endif                /* !defined(krt_next) && !defined(RTM_ADD) */
  260.   
  261. + #ifdef _AUX_SOURCE
  262.   
  263.    /*  There is a bug in the Apple A/UX 2.01 nlist function.  It will    */
  264.    /*  return a value of zero for any symbol that is in the bss region.    */
  265. ***************
  266. *** 170,175
  267.   #endif                /* !defined(krt_next) && !defined(RTM_ADD) */
  268.   
  269.   
  270.    /*    Delete a route given dest, gateway and flags    */
  271.   /*ARGSUSED*/
  272.   int
  273.  
  274. --- 167,201 -----
  275.   
  276.   #ifdef _AUX_SOURCE
  277.   
  278. +  /*  There is a bug in the Apple A/UX 2.01 nlist function.  It will    */
  279. +  /*  return a value of zero for any symbol that is in the bss region.    */
  280. +  /*  It does work correctly for symbols which are in the data region.    */
  281. +  /*  This function opens a pipe to the nm(1) command, which works    */
  282. +  /*  correctly, although more slowly, for symbols in the bss region.    */
  283. +  /*  Herb Weiner <herbw@wiskit.rain.com>                */
  284. + long pipe_nlist (symbol)
  285. + char    *symbol;
  286. + {
  287. +     char    command [256];
  288. +     char    buffer [256];
  289. +     char    *bufp;
  290. +     FILE    *symbol_pipe;
  291. +     long    value = 0;
  292. +     sprintf (command, "/bin/nm -d %s | /bin/grep %s", UNIX_NAME, symbol);
  293. +     symbol_pipe = popen (command, "r");
  294. +     fgets (buffer, sizeof (buffer), symbol_pipe);
  295. +     bufp = strchr (buffer, '|');
  296. +     if (bufp != NULL)
  297. +         sscanf (bufp, "|%ld|", &value);
  298. +     pclose (symbol_pipe);
  299. +     return (value);
  300. + }
  301. + #endif                /* _AUX_SOURCE */
  302.    /*    Delete a route given dest, gateway and flags    */
  303.   /*ARGSUSED*/
  304.   int
  305. ***************
  306. *** 1306,1311
  307.       /* Build nlist from symbol names */
  308.       nl = (struct nlist *) calloc(NL_SIZE, sizeof(struct nlist));
  309.       for (i = NL_SIZE; i--;) {
  310.       /* Use memcpy to avoid warning about const char * */
  311.       memcpy((caddr_t) & nl[i].n_name, (caddr_t) & nl_names[i].nl_name, sizeof(char *));
  312.   #ifdef    NLIST_NOUNDER
  313.  
  314. --- 1332,1343 -----
  315.       /* Build nlist from symbol names */
  316.       nl = (struct nlist *) calloc(NL_SIZE, sizeof(struct nlist));
  317.       for (i = NL_SIZE; i--;) {
  318. + #ifdef _AUX_SOURCE
  319. +     nl[i].n_nptr = nl_names[i].nl_name;
  320. +     if (nl[i].n_nptr)
  321. +         nl[i].n_nptr++;
  322. +     nl[i].n_zeroes = 0;
  323. + #else
  324.       /* Use memcpy to avoid warning about const char * */
  325.       memcpy((caddr_t) & nl[i].n_name, (caddr_t) & nl_names[i].nl_name, sizeof(char *));
  326.   #ifdef    NLIST_NOUNDER
  327. ***************
  328. *** 1313,1318
  329.           nl[i].n_name++;
  330.       }
  331.   #endif                /* NLIST_NOUNDER */
  332.       if (nl_names[i].nl_ptr) {
  333.           *nl_names[i].nl_ptr = &nl[i];
  334.       }
  335.  
  336. --- 1345,1351 -----
  337.           nl[i].n_name++;
  338.       }
  339.   #endif                /* NLIST_NOUNDER */
  340. + #endif                /* _AUX_SOURCE */
  341.       if (nl_names[i].nl_ptr) {
  342.           *nl_names[i].nl_ptr = &nl[i];
  343.       }
  344. ***************
  345. *** 1328,1333
  346.           quit(errno);
  347.       }
  348.       }
  349.       kmem = open("/dev/kmem", O_RDONLY, 0);
  350.       if (kmem < 0) {
  351.       trace(TR_ALL, LOG_ERR, "krt_init: open(\"/dev/kmem\"): %m");
  352.  
  353. --- 1361,1375 -----
  354.           quit(errno);
  355.       }
  356.       }
  357. + #ifdef _AUX_SOURCE
  358. +     /* Use nm(1) to get the value of symbols in the bss region */
  359. +     if (krt_rt[KRT_RTHOST]->n_value == 0)
  360. +     krt_rt[KRT_RTHOST]->n_value = pipe_nlist (krt_rt[KRT_RTHOST]->n_nptr);
  361. +     if (krt_rt[KRT_RTNET]->n_value == 0)
  362. +     krt_rt[KRT_RTNET]->n_value = pipe_nlist (krt_rt[KRT_RTNET]->n_nptr);
  363. + #endif                /* _AUX_SOURCE */
  364.       kmem = open("/dev/kmem", O_RDONLY, 0);
  365.       if (kmem < 0) {
  366.       trace(TR_ALL, LOG_ERR, "krt_init: open(\"/dev/kmem\"): %m");
  367. *** src/trace.c.ORIGINAL    Sun Sep  5 19:41:06 1993
  368. --- src/trace.c    Sun Sep  5 19:41:06 1993
  369. ***************
  370. *** 456,462
  371.   #ifdef    vax11c
  372.       if (trace_FILE && (trace_FILE != sstdout)) {
  373.   #endif    /* vax11c */
  374. !     if ((trace_flags & flags) & ~TR_NOSTAMP) {
  375.           *time_buffer = 0;
  376.           if (!((trace_flags | flags) & TR_NOSTAMP)) {
  377.           tm = localtime(&time_sec);
  378.  
  379. --- 456,463 -----
  380.   #ifdef    vax11c
  381.       if (trace_FILE && (trace_FILE != sstdout)) {
  382.   #endif    /* vax11c */
  383. !     if (((trace_flags & flags) & ~TR_NOSTAMP) || pri)
  384. !     {
  385.           *time_buffer = 0;
  386.           if (!((trace_flags | flags) & TR_NOSTAMP)) {
  387.           tm = localtime(&time_sec);
  388. ***************
  389. *** 467,477
  390.           (void) sprintf(&time_buffer[strlen(time_buffer)], "[%d] ",
  391.                      my_pid);
  392.           }
  393. !         if (*time_buffer) {
  394. !         (void) fputs(time_buffer, trace_FILE);
  395. !         }
  396. !         (void) fputs((char *) trace_buffer, trace_FILE);
  397. !         (void) fputc('\n', trace_FILE);
  398.       }
  399.       if (pri && !test_flag) {
  400.           syslog(pri, (char *) trace_buffer);
  401.  
  402. --- 468,480 -----
  403.           (void) sprintf(&time_buffer[strlen(time_buffer)], "[%d] ",
  404.                      my_pid);
  405.           }
  406. !         if (trace_FILE)
  407. !         {
  408. !             if (*time_buffer)
  409. !                 (void) fputs(time_buffer, trace_FILE);
  410. !             (void) fputs((char *) trace_buffer, trace_FILE);
  411. !             (void) fputc('\n', trace_FILE);
  412. !         }
  413.       }
  414.   /* --------------------------------------------
  415.       if (pri && !test_flag) {
  416. ***************
  417. *** 473,478
  418.           (void) fputs((char *) trace_buffer, trace_FILE);
  419.           (void) fputc('\n', trace_FILE);
  420.       }
  421.       if (pri && !test_flag) {
  422.           syslog(pri, (char *) trace_buffer);
  423.       }
  424.  
  425. --- 476,482 -----
  426.               (void) fputc('\n', trace_FILE);
  427.           }
  428.       }
  429. + /* --------------------------------------------
  430.       if (pri && !test_flag) {
  431.           syslog(pri, (char *) trace_buffer);
  432.       }
  433. ***************
  434. *** 476,481
  435.       if (pri && !test_flag) {
  436.           syslog(pri, (char *) trace_buffer);
  437.       }
  438.   #ifdef    vax11c
  439.       } else {
  440.       if (((trace_flags & flags) & ~TR_NOSTAMP) || (pri && !test_flag))
  441.  
  442. --- 480,486 -----
  443.       if (pri && !test_flag) {
  444.           syslog(pri, (char *) trace_buffer);
  445.       }
  446. + -------------------------------------------- */
  447.   #ifdef    vax11c
  448.       } else {
  449.       if (((trace_flags & flags) & ~TR_NOSTAMP) || (pri && !test_flag))
  450.