home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / rpc / xdr_rec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-01  |  15.6 KB  |  609 lines

  1. /* @(#)xdr_rec.c    2.2 88/08/01 4.0 RPCSRC */
  2. /*
  3.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  4.  * unrestricted use provided that this legend is included on all tape
  5.  * media and as a part of the software program in whole or part.  Users
  6.  * may copy or modify Sun RPC without charge, but are not authorized
  7.  * to license or distribute it to anyone else except as part of a product or
  8.  * program developed by the user.
  9.  * 
  10.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  11.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  12.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  13.  * 
  14.  * Sun RPC is provided with no support and without any obligation on the
  15.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  16.  * modification or enhancement.
  17.  * 
  18.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  19.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  20.  * OR ANY PART THEREOF.
  21.  * 
  22.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  23.  * or profits or other special, indirect and consequential damages, even if
  24.  * Sun has been advised of the possibility of such damages.
  25.  * 
  26.  * Sun Microsystems, Inc.
  27.  * 2550 Garcia Avenue
  28.  * Mountain View, California  94043
  29.  */
  30. #if !defined(lint) && defined(SCCSIDS)
  31. static char sccsid[] = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";
  32. #endif
  33.  
  34. /*
  35.  * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
  36.  * layer above tcp (for rpc's use).
  37.  *
  38.  * Copyright (C) 1984, Sun Microsystems, Inc.
  39.  *
  40.  * These routines interface XDRSTREAMS to a tcp/ip connection.
  41.  * There is a record marking layer between the xdr stream
  42.  * and the tcp transport level.  A record is composed on one or more
  43.  * record fragments.  A record fragment is a thirty-two bit header followed
  44.  * by n bytes of data, where n is contained in the header.  The header
  45.  * is represented as a htonl(u_long).  Thegh order bit encodes
  46.  * whether or not the fragment is the last fragment of the record
  47.  * (1 => fragment is last, 0 => more fragments to follow. 
  48.  * The other 31 bits encode the byte length of the fragment.
  49.  */
  50.  
  51. #include <stdio.h>
  52. #include <rpc/types.h>
  53. #include <rpc/xdr.h>
  54. #include <netinet/in.h>
  55. #include <strings.h>
  56. #include <unistd.h>
  57.  
  58. #ifdef __STDC__
  59. #include <stdlib.h>
  60. #endif
  61.  
  62. #ifndef linux
  63. extern long    lseek();
  64. #endif
  65.  
  66. #if NLS
  67. #include "nl_types.h"
  68. #endif
  69.  
  70. static u_int    fix_buf_size();
  71.  
  72. static bool_t    xdrrec_getlong();
  73. static bool_t    xdrrec_putlong();
  74. static bool_t    xdrrec_getbytes();
  75. static bool_t    xdrrec_putbytes();
  76. static u_int    xdrrec_getpos();
  77. static bool_t    xdrrec_setpos();
  78. static long *    xdrrec_inline();
  79. static void    xdrrec_destroy();
  80.  
  81. static struct  xdr_ops xdrrec_ops = {
  82.     xdrrec_getlong,
  83.     xdrrec_putlong,
  84.     xdrrec_getbytes,
  85.     xdrrec_putbytes,
  86.     xdrrec_getpos,
  87.     xdrrec_setpos,
  88.     xdrrec_inline,
  89.     xdrrec_destroy
  90. };
  91.  
  92. /*
  93.  * A record is composed of one or more record fragments.
  94.  * A record fragment is a two-byte header followed by zero to
  95.  * 2**32-1 bytes.  The header is treated as a long unsigned and is
  96.  * encode/decoded to the network via htonl/ntohl.  The low order 31 bits
  97.  * are a byte count of the fragment.  The highest order bit is a boolean:
  98.  * 1 => this fragment is the last fragment of the record,
  99.  * 0 => this fragment is followed by more fragment(s).
  100.  *
  101.  * The fragment/record machinery is not general;  it is constructed to
  102.  * meet the needs of xdr and rpc based on tcp.
  103.  */
  104.  
  105. #define LAST_FRAG ((u_long)(1 << 31))
  106.  
  107. typedef struct rec_strm {
  108.     caddr_t tcp_handle;
  109.     caddr_t the_buffer;
  110.     /*
  111.      * out-goung bits
  112.      */
  113.     int (*writeit)();
  114.     caddr_t out_base;    /* output buffer (points to frag header) */
  115.     caddr_t out_finger;    /* next output position */
  116.     caddr_t out_boundry;    /* data cannot up to this address */
  117.     u_long *frag_header;    /* beginning of curren fragment */
  118.     bool_t frag_sent;    /* true if buffer sent in middle of record */
  119.     /*
  120.      * in-coming bits
  121.      */
  122.     int (*readit)();
  123.     u_long in_size;    /* fixed size of the input buffer */
  124.     caddr_t in_base;
  125.     caddr_t in_finger;    /* location of next byte to be had */
  126.     caddr_t in_boundry;    /* can read up to this location */
  127.     long fbtbc;        /* fragment bytes to be consumed */
  128.     bool_t last_frag;
  129.     u_int sendsize;
  130.     u_int recvsize;
  131. } RECSTREAM;
  132.  
  133.  
  134. /*
  135.  * Internal useful routines
  136.  */
  137. static bool_t
  138. flush_out(rstrm, eor)
  139.     register RECSTREAM *rstrm;
  140.     bool_t eor;
  141. {
  142.     register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
  143.     register u_long len = (u_long)(rstrm->out_finger) - 
  144.         (u_long)(rstrm->frag_header) - sizeof(u_long);
  145.  
  146.     *(rstrm->frag_header) = htonl(len | eormask);
  147.     len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->out_base);
  148.     if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len)
  149.         != (int)len)
  150.         return (FALSE);
  151.     rstrm->frag_header = (u_long *)rstrm->out_base;
  152.     rstrm->out_finger = (caddr_t)rstrm->out_base + sizeof(u_long);
  153.     return (TRUE);
  154. }
  155.  
  156. static bool_t  /* knows nothing about records!  Only about input buffers */
  157. fill_input_buf(rstrm)
  158.     register RECSTREAM *rstrm;
  159. {
  160.     register caddr_t where;
  161.     u_int i;
  162.     register int len;
  163.  
  164.     where = rstrm->in_base;
  165.     i = (u_int)rstrm->in_boundry % BYTES_PER_XDR_UNIT;
  166.     where += i;
  167.     len = rstrm->in_size - i;
  168.     if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1)
  169.         return (FALSE);
  170.     rstrm->in_finger = where;
  171.     where += len;
  172.     rstrm->in_boundry = where;
  173.     return (TRUE);
  174. }
  175.  
  176. static bool_t  /* knows nothing about records!  Only about input buffers */
  177. get_input_bytes(rstrm, addr, len)
  178.     register RECSTREAM *rstrm;
  179.     register caddr_t addr;
  180.     register int len;
  181. {
  182.     register int current;
  183.  
  184.     while (len > 0) {
  185.         current = (int)rstrm->in_boundry - (int)rstrm->in_finger;
  186.         if (current == 0) {
  187.             if (! fill_input_buf(rstrm))
  188.                 return (FALSE);
  189.             continue;
  190.         }
  191.         current = (len < current) ? len : current;
  192.         bcopy(rstrm->in_finger, addr, current);
  193.         rstrm->in_finger += current;
  194.         addr += current;
  195.         len -= current;
  196.     }
  197.     return (TRUE);
  198. }
  199.  
  200. static bool_t  /* next two bytes of the input stream are treated as a header */
  201. set_input_fragment(rstrm)
  202.     register RECSTREAM *rstrm;
  203. {
  204.     u_long header;
  205.  
  206.     if (! get_input_bytes(rstrm, (caddr_t)&header, sizeof(header)))
  207.         return (FALSE);
  208.     header = (long)ntohl(header);
  209.     rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE;
  210.     rstrm->fbtbc = header & (~LAST_FRAG);
  211.     return (TRUE);
  212. }
  213.  
  214. static bool_t  /* consumes input bytes; knows nothing about records! */
  215. skip_input_bytes(rstrm, cnt)
  216.     register RECSTREAM *rstrm;
  217.     long cnt;
  218. {
  219.     register int current;
  220.  
  221.     while (cnt > 0) {
  222.         current = (int)rstrm->in_boundry - (int)rstrm->in_finger;
  223.         if (current == 0) {
  224.             if (! fill_input_buf(rstrm))
  225.                 return (FALSE);
  226.             continue;
  227.         }
  228.         current = (cnt < current) ? cnt : current;
  229.         rstrm->in_finger += current;
  230.         cnt -= current;
  231.     }
  232.     return (TRUE);
  233. }
  234.  
  235. static u_int
  236. fix_buf_size(s)
  237.     register u_int s;
  238. {
  239.  
  240.     if (s < 100)
  241.         s = 4000;
  242.     return (RNDUP(s));
  243. }
  244.  
  245.  
  246. /*
  247.  * Create an xdr handle for xdrrec
  248.  * xdrrec_create fills in xdrs.  Sendsize and recvsize are
  249.  * send and recv buffer sizes (0 => use default).
  250.  * tcp_handle is an opaque handle that is passed as the first parameter to
  251.  * the procedures readit and writeit.  Readit and writeit are read and
  252.  * write respectively.   They are like the system
  253.  * calls expect that they take an opaque handle rather than an fd.
  254.  */
  255. void
  256. xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
  257.     register XDR *xdrs;
  258.     register u_int sendsize;
  259.     register u_int recvsize;
  260.     caddr_t tcp_handle;
  261.     int (*readit)();  /* like read, but pass it a tcp_handle, not sock */
  262.     int (*writeit)();  /* like write, but pass it a tcp_handle, not sock */
  263. {
  264.     register RECSTREAM *rstrm =
  265.         (RECSTREAM *)mem_alloc(sizeof(RECSTREAM));
  266.  
  267. #if NLS
  268.     libc_nls_init();
  269. #endif
  270.  
  271.     if (rstrm == NULL) {
  272. #if NLS
  273.         (void)fprintf(stderr, "xdrrec_create: %s\n",
  274.                               catgets(_libc_cat, RpcMiscSet,
  275.                                       RpcMiscOutOfMemory, "out of memory"));
  276. #else
  277.         (void)fprintf(stderr, "xdrrec_create: out of memory\n");
  278. #endif
  279.         /* 
  280.          *  This is bad.  Should rework xdrrec_create to 
  281.          *  return a handle, and in this case return NULL
  282.          */
  283.         return;
  284.     }
  285.     /*
  286.      * adjust sizes and allocate buffer quad byte aligned
  287.      */
  288.     rstrm->sendsize = sendsize = fix_buf_size(sendsize);
  289.     rstrm->recvsize = recvsize = fix_buf_size(recvsize);
  290.     rstrm->the_buffer = mem_alloc(sendsize + recvsize + BYTES_PER_XDR_UNIT);
  291.     if (rstrm->the_buffer == NULL) {
  292. #if NLS
  293.         (void)fprintf(stderr, "xdrrec_create: %s\n",
  294.                               catgets(_libc_cat, RpcMiscSet,
  295.                                       RpcMiscOutOfMemory, "out of memory"));
  296. #else
  297.         (void)fprintf(stderr, "xdrrec_create: out of memory\n");
  298. #endif
  299.         return;
  300.     }
  301.     for (rstrm->out_base = rstrm->the_buffer;
  302.         (u_int)rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
  303.         rstrm->out_base++);
  304.     rstrm->in_base = rstrm->out_base + sendsize;
  305.     /*
  306.      * now the rest ...
  307.      */
  308.     xdrs->x_ops = &xdrrec_ops;
  309.     xdrs->x_private = (caddr_t)rstrm;
  310.     rstrm->tcp_handle = tcp_handle;
  311.     rstrm->readit = readit;
  312.     rstrm->writeit = writeit;
  313.     rstrm->out_finger = rstrm->out_boundry = rstrm->out_base;
  314.     rstrm->frag_header = (u_long *)rstrm->out_base;
  315.     rstrm->out_finger += sizeof(u_long);
  316.     rstrm->out_boundry += sendsize;
  317.     rstrm->frag_sent = FALSE;
  318.     rstrm->in_size = recvsize;
  319.     rstrm->in_boundry = rstrm->in_base;
  320.     rstrm->in_finger = (rstrm->in_boundry += recvsize);
  321.     rstrm->fbtbc = 0;
  322.     rstrm->last_frag = TRUE;
  323. }
  324.  
  325.  
  326. /*
  327.  * The reoutines defined below are the xdr ops which will go into the
  328.  * xdr handle filled in by xdrrec_create.
  329.  */
  330.  
  331. static bool_t
  332. xdrrec_getlong(xdrs, lp)
  333.     XDR *xdrs;
  334.     long *lp;
  335. {
  336.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  337.     register long *buflp = (long *)(rstrm->in_finger);
  338.     long mylong;
  339.  
  340.     /* first try the inline, fast case */
  341.     if ((rstrm->fbtbc >= sizeof(long)) &&
  342.         (((int)rstrm->in_boundry - (int)buflp) >= sizeof(long))) {
  343.         *lp = (long)ntohl((u_long)(*buflp));
  344.         rstrm->fbtbc -= sizeof(long);
  345.         rstrm->in_finger += sizeof(long);
  346.     } else {
  347.         if (! xdrrec_getbytes(xdrs, (caddr_t)&mylong, sizeof(long)))
  348.             return (FALSE);
  349.         *lp = (long)ntohl((u_long)mylong);
  350.     }
  351.     return (TRUE);
  352. }
  353.  
  354. static bool_t
  355. xdrrec_putlong(xdrs, lp)
  356.     XDR *xdrs;
  357.     long *lp;
  358. {
  359.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  360.     register long *dest_lp = ((long *)(rstrm->out_finger));
  361.  
  362.     if ((rstrm->out_finger += sizeof(long)) > rstrm->out_boundry) {
  363.         /*
  364.          * this case should almost never happen so the code is
  365.          * inefficient
  366.          */
  367.         rstrm->out_finger -= sizeof(long);
  368.         rstrm->frag_sent = TRUE;
  369.         if (! flush_out(rstrm, FALSE))
  370.             return (FALSE);
  371.         dest_lp = ((long *)(rstrm->out_finger));
  372.         rstrm->out_finger += sizeof(long);
  373.     }
  374.     *dest_lp = (long)htonl((u_long)(*lp));
  375.     return (TRUE);
  376. }
  377.  
  378. static bool_t  /* must manage buffers, fragments, and records */
  379. xdrrec_getbytes(xdrs, addr, len)
  380.     XDR *xdrs;
  381.     register caddr_t addr;
  382.     register u_int len;
  383. {
  384.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  385.     register int current;
  386.  
  387.     while (len > 0) {
  388.         current = rstrm->fbtbc;
  389.         if (current == 0) {
  390.             if (rstrm->last_frag)
  391.                 return (FALSE);
  392.             if (! set_input_fragment(rstrm))
  393.                 return (FALSE);
  394.             continue;
  395.         }
  396.         current = (len < current) ? len : current;
  397.         if (! get_input_bytes(rstrm, addr, current))
  398.             return (FALSE);
  399.         addr += current; 
  400.         rstrm->fbtbc -= current;
  401.         len -= current;
  402.     }
  403.     return (TRUE);
  404. }
  405.  
  406. static bool_t
  407. xdrrec_putbytes(xdrs, addr, len)
  408.     XDR *xdrs;
  409.     register caddr_t addr;
  410.     register u_int len;
  411. {
  412.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  413.     register int current;
  414.  
  415.     while (len > 0) {
  416.         current = (u_int)rstrm->out_boundry - (u_int)rstrm->out_finger;
  417.         current = (len < current) ? len : current;
  418.         bcopy(addr, rstrm->out_finger, current);
  419.         rstrm->out_finger += current;
  420.         addr += current;
  421.         len -= current;
  422.         if (rstrm->out_finger == rstrm->out_boundry) {
  423.             rstrm->frag_sent = TRUE;
  424.             if (! flush_out(rstrm, FALSE))
  425.                 return (FALSE);
  426.         }
  427.     }
  428.     return (TRUE);
  429. }
  430.  
  431. static u_int
  432. xdrrec_getpos(xdrs)
  433.     register XDR *xdrs;
  434. {
  435.     register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
  436.     register long pos;
  437.  
  438.     pos = lseek((int)rstrm->tcp_handle, (long) 0, 1);
  439.     if (pos != -1)
  440.         switch (xdrs->x_op) {
  441.  
  442.         case XDR_ENCODE:
  443.             pos += rstrm->out_finger - rstrm->out_base;
  444.             break;
  445.  
  446.         case XDR_DECODE:
  447.             pos -= rstrm->in_boundry - rstrm->in_finger;
  448.             break;
  449.  
  450.         default:
  451.             pos = (u_int) -1;
  452.             break;
  453.         }
  454.     return ((u_int) pos);
  455. }
  456.  
  457. static bool_t
  458. xdrrec_setpos(xdrs, pos)
  459.     register XDR *xdrs;
  460.     u_int pos;
  461. {
  462.     register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
  463.     u_int currpos = xdrrec_getpos(xdrs);
  464.     int delta = currpos - pos;
  465.     caddr_t newpos;
  466.  
  467.     if ((int)currpos != -1)
  468.         switch (xdrs->x_op) {
  469.  
  470.         case XDR_ENCODE:
  471.             newpos = rstrm->out_finger - delta;
  472.             if ((newpos > (caddr_t)(rstrm->frag_header)) &&
  473.                 (newpos < rstrm->out_boundry)) {
  474.                 rstrm->out_finger = newpos;
  475.                 return (TRUE);
  476.             }
  477.             break;
  478.  
  479.         case XDR_DECODE:
  480.             newpos = rstrm->in_finger - delta;
  481.             if ((delta < (int)(rstrm->fbtbc)) &&
  482.                 (newpos <= rstrm->in_boundry) &&
  483.                 (newpos >= rstrm->in_base)) {
  484.                 rstrm->in_finger = newpos;
  485.                 rstrm->fbtbc -= delta;
  486.                 return (TRUE);
  487.             }
  488.             break;
  489.         }
  490.     return (FALSE);
  491. }
  492.  
  493. static long *
  494. xdrrec_inline(xdrs, len)
  495.     register XDR *xdrs;
  496.     int len;
  497. {
  498.     register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
  499.     long * buf = NULL;
  500.  
  501.     switch (xdrs->x_op) {
  502.  
  503.     case XDR_ENCODE:
  504.         if ((rstrm->out_finger + len) <= rstrm->out_boundry) {
  505.             buf = (long *) rstrm->out_finger;
  506.             rstrm->out_finger += len;
  507.         }
  508.         break;
  509.  
  510.     case XDR_DECODE:
  511.         if ((len <= rstrm->fbtbc) &&
  512.             ((rstrm->in_finger + len) <= rstrm->in_boundry)) {
  513.             buf = (long *) rstrm->in_finger;
  514.             rstrm->fbtbc -= len;
  515.             rstrm->in_finger += len;
  516.         }
  517.         break;
  518.     }
  519.     return (buf);
  520. }
  521.  
  522. static void
  523. xdrrec_destroy(xdrs)
  524.     register XDR *xdrs;
  525. {
  526.     register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
  527.  
  528.     mem_free(rstrm->the_buffer,
  529.         rstrm->sendsize + rstrm->recvsize + BYTES_PER_XDR_UNIT);
  530.     mem_free((caddr_t)rstrm, sizeof(RECSTREAM));
  531. }
  532.  
  533.  
  534. /*
  535.  * Exported routines to manage xdr records
  536.  */
  537.  
  538. /*
  539.  * Before reading (deserializing from the stream, one should always call
  540.  * this procedure to guarantee proper record alignment.
  541.  */
  542. bool_t
  543. xdrrec_skiprecord(xdrs)
  544.     XDR *xdrs;
  545. {
  546.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  547.  
  548.     while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) {
  549.         if (! skip_input_bytes(rstrm, rstrm->fbtbc))
  550.             return (FALSE);
  551.         rstrm->fbtbc = 0;
  552.         if ((! rstrm->last_frag) && (! set_input_fragment(rstrm)))
  553.             return (FALSE);
  554.     }
  555.     rstrm->last_frag = FALSE;
  556.     return (TRUE);
  557. }
  558.  
  559. /*
  560.  * Look ahead fuction.
  561.  * Returns TRUE iff there is no more input in the buffer 
  562.  * after consuming the rest of the current record.
  563.  */
  564. bool_t
  565. xdrrec_eof(xdrs)
  566.     XDR *xdrs;
  567. {
  568.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  569.  
  570.     while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) {
  571.         if (! skip_input_bytes(rstrm, rstrm->fbtbc))
  572.             return (TRUE);
  573.         rstrm->fbtbc = 0;
  574.         if ((! rstrm->last_frag) && (! set_input_fragment(rstrm)))
  575.             return (TRUE);
  576.     }
  577.     if (rstrm->in_finger == rstrm->in_boundry)
  578.         return (TRUE);
  579.     return (FALSE);
  580. }
  581.  
  582. /*
  583.  * The client must tell the package when an end-of-record has occurred.
  584.  * The second paraemters tells whether the record should be flushed to the
  585.  * (output) tcp stream.  (This let's the package support batched or
  586.  * pipelined procedure calls.)  TRUE => immmediate flush to tcp connection.
  587.  */
  588. bool_t
  589. xdrrec_endofrecord(xdrs, sendnow)
  590.     XDR *xdrs;
  591.     bool_t sendnow;
  592. {
  593.     register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
  594.     register u_long len;  /* fragment length */
  595.  
  596.     if (sendnow || rstrm->frag_sent ||
  597.         ((u_long)rstrm->out_finger + sizeof(u_long) >=
  598.         (u_long)rstrm->out_boundry)) {
  599.         rstrm->frag_sent = FALSE;
  600.         return (flush_out(rstrm, TRUE));
  601.     }
  602.     len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->frag_header) -
  603.        sizeof(u_long);
  604.     *(rstrm->frag_header) = htonl((u_long)len | LAST_FRAG);
  605.     rstrm->frag_header = (u_long *)rstrm->out_finger;
  606.     rstrm->out_finger += sizeof(u_long);
  607.     return (TRUE);
  608. }
  609.