/* * @DEC_COPYRIGHT@ */ /* * HISTORY * $Log: if_dl.h,v $ * Revision 4.2.11.1 2000/09/25 22:40:44 Brian_Haley * Changed AF_DLI comment to AF_LINK. * * Revision 4.2.9.3 1999/02/09 19:03:30 Ken_Block * Make header C++ compliant. * [1998/12/29 20:18:28 Ken_Block] * * Revision 4.2.9.2 1996/12/09 22:01:22 Neil_Lewis * Add a prototype for a reentrant form of a function. (link_ntoa_r) * [1996/11/19 18:49:53 Neil_Lewis] * * Revision 4.2.6.3 1993/10/07 21:58:33 Geraldine_Harter * Merge with Sterling BL6: * * Revision 4.2.7.2 1993/06/29 17:30:50 SJ_Lee * add #ifndef * [1993/06/29 17:04:17 SJ_Lee] * * Revision 4.2.6.2 1993/06/25 21:16:25 Geraldine_Harter * Merge OSF1.2 changes. * [1993/06/25 20:26:04 Geraldine_Harter] * * Revision 4.2.3.2 1992/04/06 14:19:12 Geraldine_Harter * Increased the size of sdl_data[] from 12 to 16, since this work area is * allowed to be larger. This is needed to pad out the structure size to be * evenly divisible by the machine pointer size. This ensures that multiple * sockaddr_dl structures passed back to the user in response to a * (O)SIOCGIFCONF ioctl request will always be aligned on a machine-pointer * boundary (eg. 8 bytes for Alpha). * [92/04/06 14:17:20 Geraldine_Harter] * * Revision 4.2 91/09/19 22:44:57 devbld * Adding ODE Headers * * $EndLog$ */ /* * @(#)$RCSfile: if_dl.h,v $ $Revision: 4.2.11.1 $ (DEC) $Date: 2000/09/25 22:40:44 $ */ /* */ /* * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED */ /* * OSF/1 Release 1.0 */ /* * Copyright (c) 1990 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted provided * that: (1) source distributions retain this entire copyright notice and * comment, and (2) distributions including binaries display the following * acknowledgement: ``This product includes software developed by the * University of California, Berkeley and its contributors'' in the * documentation or other materials provided with the distribution and in * all advertising materials mentioning features or use of this software. * Neither the name of the University nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Base: if_dl.h 7.1 (Berkeley) 7/1/90 */ /* * A Link-Level Sockaddr may specify the interface in one of two * ways: either by means of a system-provided index number (computed * anew and possibly differently on every reboot), or by a human-readable * string such as "il0" (for managerial convenience). * * Census taking actions, such as something akin to SIOCGCONF would return * both the index and the human name. * * High volume transactions (such as giving a link-level ``from'' address * in a recvfrom or recvmsg call) may be likely only to provide the indexed * form, (which requires fewer copy operations and less space). * * The form and interpretation of the link-level address is purely a matter * of convention between the device driver and its consumers; however, it is * expected that all drivers for an interface of a given if_type will agree. */ #ifndef _IF_DL_H_ #define _IF_DL_H_ #ifdef __cplusplus extern "C" { #endif /* * Structure of a Link-Level sockaddr: */ struct sockaddr_dl { u_char sdl_len; /* Total length of sockaddr */ u_char sdl_family; /* AF_LINK */ 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[16]; /* minimum work area, can be larger; contains both if name and ll address */ }; #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) #ifndef _KERNEL #ifdef _NO_PROTO extern void link_addr(); extern char * link_ntoa(); #if defined(_REENTRANT) || defined(_THREAD_SAFE) extern int link_ntoa_r(); #endif /* _REENTRANT || _THREAD_SAFE */ #else extern void link_addr(const char *, struct sockaddr_dl *); extern char * link_ntoa(const struct sockaddr_dl *); #if defined(_REENTRANT) || defined(_THREAD_SAFE) extern int link_ntoa_r(const struct sockaddr_dl *, char *, int); #endif /* _REENTRANT || _THREAD_SAFE */ #endif #endif #ifdef __cplusplus } /* extern "C" */ #endif #endif /* _IF_DL_H_ */