|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1990 Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution is only permitted until one year after the first shipment ! 6: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and ! 7: * binary forms are permitted provided that: (1) source distributions retain ! 8: * this entire copyright notice and comment, and (2) distributions including ! 9: * binaries display the following acknowledgement: This product includes ! 10: * software developed by the University of California, Berkeley and its ! 11: * contributors'' in the documentation or other materials provided with the ! 12: * distribution and in all advertising materials mentioning features or use ! 13: * of this software. Neither the name of the University nor the names of ! 14: * its contributors may be used to endorse or promote products derived from ! 15: * this software without specific prior written permission. ! 16: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 17: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 19: * ! 20: * @(#)if_dl.h 7.1 (Berkeley) 7/1/90 ! 21: */ ! 22: ! 23: /* ! 24: * A Link-Level Sockaddr may specify the interface in one of two ! 25: * ways: either by means of a system-provided index number (computed ! 26: * anew and possibly differently on every reboot), or by a human-readable ! 27: * string such as "il0" (for managerial convenience). ! 28: * ! 29: * Census taking actions, such as something akin to SIOCGCONF would return ! 30: * both the index and the human name. ! 31: * ! 32: * High volume transactions (such as giving a link-level ``from'' address ! 33: * in a recvfrom or recvmsg call) may be likely only to provide the indexed ! 34: * form, (which requires fewer copy operations and less space). ! 35: * ! 36: * The form and interpretation of the link-level address is purely a matter ! 37: * of convention between the device driver and its consumers; however, it is ! 38: * expected that all drivers for an interface of a given if_type will agree. ! 39: */ ! 40: ! 41: /* ! 42: * Structure of a Link-Level sockaddr: ! 43: */ ! 44: struct sockaddr_dl { ! 45: u_char sdl_len; /* Total length of sockaddr */ ! 46: u_char sdl_family; /* AF_DLI */ ! 47: u_short sdl_index; /* if != 0, system given index for interface */ ! 48: u_char sdl_type; /* interface type */ ! 49: u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */ ! 50: u_char sdl_alen; /* link level address length */ ! 51: u_char sdl_slen; /* link layer selector length */ ! 52: char sdl_data[12]; /* minimum work area, can be larger; ! 53: contains both if name and ll address */ ! 54: }; ! 55: ! 56: #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) ! 57:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.