Changeset a3c06e11 in rtems


Ignore:
Timestamp:
Apr 18, 2005, 5:20:02 AM (15 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
145c5561
Parents:
c834daa
Message:

Cosmetics from FreeBSD.

Location:
cpukit/libnetworking
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/net/if.c

    rc834daa ra3c06e11  
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    1713 * 4. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
     
    3127 * SUCH DAMAGE.
    3228 *
    33  *      @(#)if.c        8.3 (Berkeley) 1/4/94
     29 *      @(#)if.c        8.5 (Berkeley) 1/9/95
     30 * $FreeBSD: src/sys/net/if.c,v 1.226 2005/04/15 01:51:26 cperciva Exp $
     31 */
     32
     33/*
    3434 * $Id$
    3535 */
     
    5858 */
    5959
    60 static int ifconf __P((int, caddr_t));
    61        void ifinit __P((void *));
    62 static void if_qflush __P((struct ifqueue *));
    63 static void if_slowtimo __P((void *));
    64 static void link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
     60static int ifconf(u_long, caddr_t);
     61       void ifinit(void *);
     62static void if_qflush(struct ifqueue *);
     63static void if_slowtimo(void *);
     64static void link_rtrequest(int, struct rtentry *, struct sockaddr *);
    6565
    6666SYSINIT(interfaces, SI_SUB_PROTO_IF, SI_ORDER_FIRST, ifinit, NULL)
     
    8383        void *dummy;
    8484{
    85         register struct ifnet *ifp;
     85        struct ifnet *ifp;
    8686
    8787        for (ifp = ifnet; ifp; ifp = ifp->if_next)
     
    100100 */
    101101void
    102 if_attach(ifp)
    103         struct ifnet *ifp;
     102if_attach(struct ifnet *ifp)
    104103{
    105104        unsigned socksize, ifasize;
    106105        int namelen, masklen;
    107106        char workbuf[64];
    108         register struct ifnet **p = &ifnet;
    109         register struct sockaddr_dl *sdl;
    110         register struct ifaddr *ifa;
     107        struct ifnet **p = &ifnet;
     108        struct sockaddr_dl *sdl;
     109        struct ifaddr *ifa;
    111110        static int if_indexlim = 8;
    112111
     
    169168/*ARGSUSED*/
    170169struct ifaddr *
    171 ifa_ifwithaddr(addr)
    172         register struct sockaddr *addr;
    173 {
    174         register struct ifnet *ifp;
    175         register struct ifaddr *ifa;
     170ifa_ifwithaddr(struct sockaddr *addr)
     171{
     172        struct ifnet *ifp;
     173        struct ifaddr *ifa;
    176174
    177175#define equal(a1, a2) \
     
    194192/*ARGSUSED*/
    195193struct ifaddr *
    196 ifa_ifwithdstaddr(addr)
    197         register struct sockaddr *addr;
    198 {
    199         register struct ifnet *ifp;
    200         register struct ifaddr *ifa;
     194ifa_ifwithdstaddr(struct sockaddr *addr)
     195{
     196        struct ifnet *ifp;
     197        struct ifaddr *ifa;
    201198
    202199        for (ifp = ifnet; ifp; ifp = ifp->if_next)
     
    216213 */
    217214struct ifaddr *
    218 ifa_ifwithnet(addr)
    219         struct sockaddr *addr;
    220 {
    221         register struct ifnet *ifp;
    222         register struct ifaddr *ifa;
     215ifa_ifwithnet(struct sockaddr *addr)
     216{
     217        struct ifnet *ifp;
     218        struct ifaddr *ifa;
    223219        struct ifaddr *ifa_maybe = (struct ifaddr *) 0;
    224220        u_int af = addr->sa_family;
     
    226222
    227223        if (af == AF_LINK) {
    228             register struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr;
     224            struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr;
    229225            if (sdl->sdl_index && sdl->sdl_index <= if_index)
    230226                return (ifnet_addrs[sdl->sdl_index - 1]);
     
    232228        for (ifp = ifnet; ifp; ifp = ifp->if_next) {
    233229                for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
    234                         register char *cp, *cp2, *cp3;
     230                        char *cp, *cp2, *cp3;
    235231
    236232                        if (ifa->ifa_addr->sa_family != af)
     
    265261                                cp2 = ifa->ifa_addr->sa_data;
    266262                                cp3 = ifa->ifa_netmask->sa_data;
    267                                 cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
     263                                cplim = ifa->ifa_netmask->sa_len
     264                                        + (char *)ifa->ifa_netmask;
    268265                                while (cp3 < cplim)
    269266                                        if ((*cp++ ^ *cp2++) & *cp3++)
    270                                                 goto next;
     267                                                goto next; /* next address! */
     268                                /*
     269                                 * If the netmask of what we just found
     270                                 * is more specific than what we had before
     271                                 * (if we had one) then remember the new one
     272                                 * before continuing to search
     273                                 * for an even better one.
     274                                 */
    271275                                if (ifa_maybe == 0 ||
    272276                                    rn_refines((caddr_t)ifa->ifa_netmask,
     
    284288 */
    285289struct ifaddr *
    286 ifaof_ifpforaddr(addr, ifp)
    287         struct sockaddr *addr;
    288         register struct ifnet *ifp;
    289 {
    290         register struct ifaddr *ifa;
    291         register char *cp, *cp2, *cp3;
    292         register char *cplim;
     290ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp)
     291{
     292        struct ifaddr *ifa;
     293        char *cp, *cp2, *cp3;
     294        char *cplim;
    293295        struct ifaddr *ifa_maybe = 0;
    294296        u_int af = addr->sa_family;
     
    333335 */
    334336static void
    335 link_rtrequest(cmd, rt, sa)
    336         int cmd;
    337         register struct rtentry *rt;
    338         struct sockaddr *sa;
    339 {
    340         register struct ifaddr *ifa;
     337link_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *sa)
     338{
     339        struct ifaddr *ifa;
    341340        struct sockaddr *dst;
    342341        struct ifnet *ifp;
     
    361360 */
    362361void
    363 if_down(ifp)
    364         register struct ifnet *ifp;
    365 {
    366         register struct ifaddr *ifa;
     362if_down(struct ifnet *ifp)
     363{
     364        struct ifaddr *ifa;
    367365
    368366        ifp->if_flags &= ~IFF_UP;
     
    380378 */
    381379void
    382 if_up(ifp)
    383         register struct ifnet *ifp;
     380if_up(struct ifnet *ifp)
    384381{
    385382
     
    387384        microtime(&ifp->if_lastchange);
    388385#ifdef notyet
    389         register struct ifaddr *ifa;
     386        struct ifaddr *ifa;
    390387        /* this has no effect on IP, and will kill all iso connections XXX */
    391388        for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
     
    399396 */
    400397static void
    401 if_qflush(ifq)
    402         register struct ifqueue *ifq;
    403 {
    404         register struct mbuf *m, *n;
     398if_qflush(struct ifqueue *ifq)
     399{
     400        struct mbuf *m, *n;
    405401
    406402        n = ifq->ifq_head;
     
    420416 */
    421417static void
    422 if_slowtimo(arg)
    423         void *arg;
    424 {
    425         register struct ifnet *ifp;
     418if_slowtimo(void *arg)
     419{
     420        struct ifnet *ifp;
    426421        int s = splimp();
    427422
     
    441436 */
    442437struct ifnet *
    443 ifunit(name)
    444         register char *name;
    445 {
    446         register char *cp;
    447         register struct ifnet *ifp;
     438ifunit(char *name)
     439{
     440        char *cp;
     441        struct ifnet *ifp;
    448442        int unit;
    449443        unsigned len;
     
    482476 */
    483477int
    484 ifioctl(so, cmd, data, p)
    485         struct socket *so;
    486         int cmd;
    487         caddr_t data;
    488         struct proc *p;
    489 {
    490         register struct ifnet *ifp;
    491         register struct ifreq *ifr;
     478ifioctl(struct socket *so, int cmd, caddr_t data, struct proc *p)
     479{
     480        struct ifnet *ifp;
     481        struct ifreq *ifr;
    492482        int error;
    493483
     
    687677 */
    688678int
    689 ifpromisc(ifp, pswitch)
    690         struct ifnet *ifp;
    691         int pswitch;
     679ifpromisc(struct ifnet *ifp, int pswitch)
    692680{
    693681        struct ifreq ifr;
     
    722710/*ARGSUSED*/
    723711static int
    724 ifconf(cmd, data)
    725         int cmd;
    726         caddr_t data;
    727 {
    728         register struct ifconf *ifc = (struct ifconf *)data;
    729         register struct ifnet *ifp = ifnet;
    730         register struct ifaddr *ifa;
     712ifconf(u_long cmd, caddr_t data)
     713{
     714        struct ifconf *ifc = (struct ifconf *)data;
     715        struct ifnet *ifp = ifnet;
     716        struct ifaddr *ifa;
    731717        struct ifreq ifr, *ifrp;
    732718        int space = ifc->ifc_len, error = 0;
     
    753739                } else
    754740                    for ( ; space > sizeof (ifr) && ifa; ifa = ifa->ifa_next) {
    755                         register struct sockaddr *sa = ifa->ifa_addr;
     741                        struct sockaddr *sa = ifa->ifa_addr;
    756742#ifdef COMPAT_43
    757743                        if (cmd == OSIOCGIFCONF) {
  • cpukit/libnetworking/net/if.h

    rc834daa ra3c06e11  
    246246#define IFF_PROMISC     0x100           /* receive all packets */
    247247#define IFF_ALLMULTI    0x200           /* receive all multicast packets */
    248 #define IFF_OACTIVE     0x400           /* transmission in progress */
     248#define IFF_OACTIVE     0x400           /* tx hardware queue is full */
    249249#define IFF_SIMPLEX     0x800           /* can't hear own transmissions */
    250250#define IFF_LINK0       0x1000          /* per link layer defined bit */
     
    512512int     ifioctl(struct socket *, int, caddr_t, struct proc *);
    513513int     ifpromisc(struct ifnet *, int);
    514 struct  ifnet *ifunit(char *);
    515514
    516515struct  ifaddr *ifa_ifwithaddr(struct sockaddr *);
  • cpukit/libnetworking/sys/mbuf.h

    rc834daa ra3c06e11  
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    17  * 4. Neither the name of the University nor the names of its contributors
     13 * 3. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
    1915 *    without specific prior written permission.
     
    3228 *
    3329 *      @(#)mbuf.h      8.5 (Berkeley) 2/19/95
     30 * $FreeBSD: src/sys/sys/mbuf.h,v 1.169 2005/03/17 19:34:57 jmg Exp $
     31 */
     32
     33/*
    3434 * $Id$
    3535 */
    36 
     36 
    3737#ifndef _SYS_MBUF_H_
    3838#define _SYS_MBUF_H_
     
    6464 */
    6565#define mtod(m,t)       ((t)((m)->m_data))
    66 #define dtom(x)         ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
     66#define dtom(x)         ((struct mbuf *)((intptr_t)(x) & ~(MSIZE-1)))
    6767#define mtocl(x)        (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
    6868#define cltom(x)        ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
    6969
    70 /* header at beginning of each mbuf: */
     70/*
     71 * Header present at the beginning of every mbuf.
     72 */
    7173struct m_hdr {
    7274        struct  mbuf *mh_next;          /* next buffer in chain */
     
    7476        caddr_t mh_data;                /* location of data */
    7577        int     mh_len;                 /* amount of data in this mbuf */
     78        int     mh_flags;               /* flags; see below */
    7679        short   mh_type;                /* type of data in this mbuf */
    77         short   mh_flags;               /* flags; see below */
    78 };
    79 
    80 /* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
     80};
     81
     82/*
     83 * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set.
     84 */
    8185struct  pkthdr {
    8286        struct  ifnet *rcvif;           /* rcv interface */
     
    8488};
    8589
    86 /* description of external storage mapped into mbuf, valid if M_EXT set */
     90/*
     91 * Description of external storage mapped into mbuf; valid only if M_EXT is set.
     92 */
    8793struct m_ext {
    8894        caddr_t ext_buf;                /* start of buffer */
     
    94100};
    95101
     102/*
     103 * The core of the mbuf object along with some shortcut defines for
     104 * practical purposes.
     105 */
    96106struct mbuf {
    97107        struct  m_hdr m_hdr;
Note: See TracChangeset for help on using the changeset viewer.