The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netatalk/at_rmx.c

Version: -  FREEBSD  -  FREEBSD11  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright 1994, 1995 Massachusetts Institute of Technology
    3  *
    4  * Permission to use, copy, modify, and distribute this software and
    5  * its documentation for any purpose and without fee is hereby
    6  * granted, provided that both the above copyright notice and this
    7  * permission notice appear in all copies, that both the above
    8  * copyright notice and this permission notice appear in all
    9  * supporting documentation, and that the name of M.I.T. not be used
   10  * in advertising or publicity pertaining to distribution of the
   11  * software without specific, written prior permission.  M.I.T. makes
   12  * no representations about the suitability of this software for any
   13  * purpose.  It is provided "as is" without express or implied
   14  * warranty.
   15  *
   16  * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
   17  * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
   18  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
   20  * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   23  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   25  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   27  * SUCH DAMAGE.
   28  *
   29  * at_rmx.c,v 1.13 1995/05/30 08:09:31 rgrimes Exp
   30  * $FreeBSD: stable/9/sys/netatalk/at_rmx.c 194818 2009-06-24 10:28:30Z rwatson $
   31  */
   32 
   33 /* This code generates debugging traces to the radix code. */
   34 
   35 #include <sys/param.h>
   36 #include <sys/systm.h>
   37 #include <sys/socket.h>
   38 
   39 #include <net/route.h>
   40 
   41 int     at_inithead(void **head, int off);
   42 
   43 #if 0
   44 #define HEXBUF_LEN      256
   45 
   46 static const char *
   47 prsockaddr(void *v, char *hexbuf)
   48 {
   49         char *bp = &hexbuf[0];
   50         u_char *cp = v;
   51 
   52         if (v != NULL) {
   53                 int len = *cp;
   54                 u_char *cplim = cp + len;
   55 
   56                 /* return: "(len) hexdump" */
   57 
   58                 bp += sprintf(bp, "(%d)", len);
   59                 for (cp++; cp < cplim && bp < hexbuf + (HEXBUF_LEN - 4);
   60                     cp++) {
   61                         *bp++ = "0123456789abcdef"[*cp / 16];
   62                         *bp++ = "0123456789abcdef"[*cp % 16];
   63                 }
   64         } else
   65                 bp+= sprintf(bp, "null");
   66         *bp = '\0';
   67         return (hexbuf);
   68 }
   69 #endif
   70 
   71 static struct radix_node *
   72 at_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
   73             struct radix_node *treenodes)
   74 {
   75 
   76         return (rn_addroute(v_arg, n_arg, head, treenodes));
   77 }
   78 
   79 static struct radix_node *
   80 at_matroute(void *v_arg, struct radix_node_head *head)
   81 {
   82 
   83         return (rn_match(v_arg, head));
   84 }
   85 
   86 static struct radix_node *
   87 at_lookup(void *v_arg, void *m_arg, struct radix_node_head *head)
   88 {
   89 
   90         return (rn_lookup(v_arg, m_arg, head));
   91 }
   92 
   93 static struct radix_node *
   94 at_delroute(void *v_arg, void *netmask_arg, struct radix_node_head *head)
   95 {
   96 
   97         return (rn_delete(v_arg, netmask_arg, head));
   98 }
   99 
  100 /*
  101  * Initialize our routing tree with debugging hooks.
  102  */
  103 int
  104 at_inithead(void **head, int off)
  105 {
  106         struct radix_node_head *rnh;
  107 
  108         if (!rn_inithead(head, off))
  109                 return (0);
  110 
  111         rnh = *head;
  112         rnh->rnh_addaddr = at_addroute;
  113         rnh->rnh_deladdr = at_delroute;
  114         rnh->rnh_matchaddr = at_matroute;
  115         rnh->rnh_lookup = at_lookup;
  116         return (1);
  117 }

Cache object: f30f4a15d3ef5d37e56004c627383924


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.