OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [tcpip/] [current/] [include/] [net/] [if_dl.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      include/net/if_dl.h
4
//
5
//      
6
//
7
//==========================================================================
8
// ####BSDALTCOPYRIGHTBEGIN####                                             
9
// -------------------------------------------                              
10
// Portions of this software may have been derived from OpenBSD             
11
// or other sources, and if so are covered by the appropriate copyright     
12
// and license included herein.                                             
13
// -------------------------------------------                              
14
// ####BSDALTCOPYRIGHTEND####                                               
15
//==========================================================================
16
//#####DESCRIPTIONBEGIN####
17
//
18
// Author(s):    gthomas
19
// Contributors: gthomas
20
// Date:         2000-01-10
21
// Purpose:      
22
// Description:  
23
//              
24
//
25
//####DESCRIPTIONEND####
26
//
27
//==========================================================================
28
 
29
 
30
/*      $OpenBSD: if_dl.h,v 1.2 1997/02/24 13:33:58 niklas Exp $        */
31
/*      $NetBSD: if_dl.h,v 1.8 1995/03/26 20:30:13 jtc Exp $    */
32
 
33
/*
34
 * Copyright (c) 1990, 1993
35
 *      The Regents of the University of California.  All rights reserved.
36
 *
37
 * Redistribution and use in source and binary forms, with or without
38
 * modification, are permitted provided that the following conditions
39
 * are met:
40
 * 1. Redistributions of source code must retain the above copyright
41
 *    notice, this list of conditions and the following disclaimer.
42
 * 2. Redistributions in binary form must reproduce the above copyright
43
 *    notice, this list of conditions and the following disclaimer in the
44
 *    documentation and/or other materials provided with the distribution.
45
 * 3. All advertising materials mentioning features or use of this software
46
 *    must display the following acknowledgement:
47
 *      This product includes software developed by the University of
48
 *      California, Berkeley and its contributors.
49
 * 4. Neither the name of the University nor the names of its contributors
50
 *    may be used to endorse or promote products derived from this software
51
 *    without specific prior written permission.
52
 *
53
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63
 * SUCH DAMAGE.
64
 *
65
 *      @(#)if_dl.h     8.1 (Berkeley) 6/10/93
66
 */
67
 
68
#ifndef _NET_IF_DL_H_
69
#define _NET_IF_DL_H_
70
 
71
/*
72
 * A Link-Level Sockaddr may specify the interface in one of two
73
 * ways: either by means of a system-provided index number (computed
74
 * anew and possibly differently on every reboot), or by a human-readable
75
 * string such as "il0" (for managerial convenience).
76
 *
77
 * Census taking actions, such as something akin to SIOCGCONF would return
78
 * both the index and the human name.
79
 *
80
 * High volume transactions (such as giving a link-level ``from'' address
81
 * in a recvfrom or recvmsg call) may be likely only to provide the indexed
82
 * form, (which requires fewer copy operations and less space).
83
 *
84
 * The form and interpretation  of the link-level address is purely a matter
85
 * of convention between the device driver and its consumers; however, it is
86
 * expected that all drivers for an interface of a given if_type will agree.
87
 */
88
 
89
/*
90
 * Structure of a Link-Level sockaddr:
91
 */
92
struct sockaddr_dl {
93
        u_char    sdl_len;      /* Total length of sockaddr */
94
        u_char    sdl_family;   /* AF_DLI */
95
        u_int16_t sdl_index;    /* if != 0, system given index for interface */
96
        u_char    sdl_type;     /* interface type */
97
        u_char    sdl_nlen;     /* interface name length, no trailing 0 reqd. */
98
        u_char    sdl_alen;     /* link level address length */
99
        u_char    sdl_slen;     /* link layer selector length */
100
        char      sdl_data[12]; /* minimum work area, can be larger;
101
                                   contains both if name and ll address */
102
};
103
 
104
#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
105
 
106
#ifndef _KERNEL
107
 
108
#include <sys/cdefs.h>
109
 
110
__BEGIN_DECLS
111
void    link_addr __P((const char *, struct sockaddr_dl *));
112
char    *link_ntoa __P((const struct sockaddr_dl *));
113
__END_DECLS
114
 
115
#endif /* !_KERNEL */
116
 
117
#endif // _NET_IF_DL_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.