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_var.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: at_var.h,v 1.7 2007/08/30 02:17:36 dyoung Exp $         */
    2 
    3 /*
    4  * Copyright (c) 1990,1991 Regents of The University of Michigan.
    5  * All Rights Reserved.
    6  *
    7  * Permission to use, copy, modify, and distribute this software and
    8  * its documentation for any purpose and without fee is hereby granted,
    9  * provided that the above copyright notice appears in all copies and
   10  * that both that copyright notice and this permission notice appear
   11  * in supporting documentation, and that the name of The University
   12  * of Michigan not be used in advertising or publicity pertaining to
   13  * distribution of the software without specific, written prior
   14  * permission. This software is supplied as is without expressed or
   15  * implied warranties of any kind.
   16  *
   17  * This product includes software developed by the University of
   18  * California, Berkeley and its contributors.
   19  *
   20  *      Research Systems Unix Group
   21  *      The University of Michigan
   22  *      c/o Wesley Craig
   23  *      535 W. William Street
   24  *      Ann Arbor, Michigan
   25  *      +1-313-764-2278
   26  *      netatalk@umich.edu
   27  */
   28 
   29 #ifndef _NETATALK_AT_VAR_H_
   30 #define _NETATALK_AT_VAR_H_
   31 
   32 #include <sys/callout.h>
   33 
   34 /*
   35  * For phase2, we need to keep not only our address on an interface,
   36  * but also the legal networks on the interface.
   37  */
   38 struct at_ifaddr {
   39         struct ifaddr   aa_ifa;
   40 #define aa_ifp          aa_ifa.ifa_ifp
   41         struct sockaddr_at aa_addr;
   42         struct sockaddr_at aa_broadaddr;
   43 #define aa_dstaddr      aa_broadaddr;
   44         struct sockaddr_at aa_netmask;
   45         int             aa_flags;
   46         u_short         aa_firstnet, aa_lastnet;
   47         int             aa_probcnt;
   48         TAILQ_ENTRY(at_ifaddr) aa_list; /* list of appletalk addresses */
   49         struct callout  aa_probe_ch;    /* for aarpprobe() */
   50 };
   51 
   52 struct at_aliasreq {
   53         char                    ifra_name[IFNAMSIZ];
   54         struct sockaddr_at      ifra_addr;
   55         struct sockaddr_at      ifra_broadaddr;
   56 #define ifra_dstaddr            ifra_broadaddr
   57         struct sockaddr_at      ifra_mask;
   58 };
   59 
   60 #define AA_SAT(aa) \
   61     (&(aa->aa_addr))
   62 #define satosat(sa)     ((struct sockaddr_at *)(sa))
   63 #define satocsat(sa)    ((const struct sockaddr_at *)(sa))
   64 
   65 #define AFA_ROUTE       0x0001
   66 #define AFA_PROBING     0x0002
   67 #define AFA_PHASE2      0x0004
   68 
   69 #ifdef _KERNEL
   70 int sockaddr_at_cmp(const struct sockaddr *, const struct sockaddr *);
   71 
   72 static inline void
   73 sockaddr_at_init1(struct sockaddr_at *sat, const struct at_addr *addr,
   74     uint8_t port)
   75 {
   76         sat->sat_port = port;
   77         sat->sat_addr = *addr;
   78         memset(&sat->sat_range, 0, sizeof(sat->sat_range));
   79 }
   80 
   81 static inline void
   82 sockaddr_at_init(struct sockaddr_at *sat, const struct at_addr *addr,
   83     uint8_t port)
   84 {
   85         sat->sat_family = AF_APPLETALK;
   86         sat->sat_len = sizeof(*sat);
   87         sockaddr_at_init1(sat, addr, port);
   88 }
   89 
   90 static inline struct sockaddr *
   91 sockaddr_at_alloc(const struct at_addr *addr, uint8_t port, int flags)
   92 {
   93         struct sockaddr *sa;
   94 
   95         sa = sockaddr_alloc(AF_APPLETALK, sizeof(struct sockaddr_at), flags);
   96 
   97         if (sa == NULL)
   98                 return NULL;
   99 
  100         sockaddr_at_init1(satosat(sa), addr, port);
  101 
  102         return sa;
  103 }
  104 TAILQ_HEAD(at_ifaddrhead, at_ifaddr);
  105 extern struct at_ifaddrhead at_ifaddr;
  106 extern struct ifqueue atintrq1, atintrq2;
  107 #endif
  108 
  109 #endif /* !_NETATALK_AT_VAR_H_ */

Cache object: 79c201823162b5c6488ec9aff9a816c2


[ 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.