Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Feb 1999 09:14:52 -0500 (EST)
From:      Larry Lile <lile@stdio.com>
To:        hackers@freebsd.org
Subject:   sockaddr_dl and source routing for token-ring
Message-ID:  <Pine.BSF.4.05.9902180853240.12363-100000@heathers.stdio.com>

next in thread | raw e-mail | index | archive | help

I am now working on source routing for the generic token-ring code
and it appears that sockaddr_dl is the proper place to store the
RIF.  What I am curious about is what is the "proper" way to 
store the information in sockaddr_dl?

struct sockaddr_dl {
        u_char  sdl_len;        /* Total length of sockaddr */
        u_char  sdl_family;     /* AF_DLI */
        u_short sdl_index;      /* if != 0, system given index for interface */
        u_char  sdl_type;       /* interface type */ 
        u_char  sdl_nlen;       /* interface name length, no trailing 0 reqd. */
        u_char  sdl_alen;       /* link level address length */
        u_char  sdl_slen;       /* link layer selector length */
        char    sdl_data[12];   /* minimum work area, can be larger;
                                   contains both if name and ll address */  
}; 

Should I just add "u_short sdl_routing[32] /* Token-ring source route */"
or should I append the RIF to the end of sdl_data making it
"sdl_data[78]".  I prefer adding sdl_routing so that it could be #ifdef'd
out of the kernel when no token-ring is present.

The length of the RIF can be determined from the first two bytes so either
way I should not have to add an sdl_xlen.  The reason it is 32 u_short's
long is that some token-ring vendors now allow 30 routing segments instead
of the IBM standard of 16.

Would this break anything in the network stack?  Which method is more
appropriate?  Is there another more preferable method?

Larry Lile
lile@stdio.com




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9902180853240.12363-100000>