~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to extras/mini-os/include/posix/net/if.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This code is mostly taken from NetBSD net/if.h 
 
3
 * Changes: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 
4
 *
 
5
 ******************************************************************************
 
6
 *
 
7
 * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
 
8
 * All rights reserved.
 
9
 *
 
10
 * This code is derived from software contributed to The NetBSD Foundation
 
11
 * by William Studenmund and Jason R. Thorpe.
 
12
 *
 
13
 * Redistribution and use in source and binary forms, with or without
 
14
 * modification, are permitted provided that the following conditions
 
15
 * are met:
 
16
 * 1. Redistributions of source code must retain the above copyright
 
17
 *    notice, this list of conditions and the following disclaimer.
 
18
 * 2. Redistributions in binary form must reproduce the above copyright
 
19
 *    notice, this list of conditions and the following disclaimer in the
 
20
 *    documentation and/or other materials provided with the distribution.
 
21
 *
 
22
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 
23
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 
24
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
25
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 
26
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
27
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
28
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
29
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
30
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
31
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
32
 * POSSIBILITY OF SUCH DAMAGE.
 
33
 */
 
34
 
 
35
/*
 
36
 * Copyright (c) 1982, 1986, 1989, 1993
 
37
 *      The Regents of the University of California.  All rights reserved.
 
38
 *
 
39
 * Redistribution and use in source and binary forms, with or without
 
40
 * modification, are permitted provided that the following conditions
 
41
 * are met:
 
42
 * 1. Redistributions of source code must retain the above copyright
 
43
 *    notice, this list of conditions and the following disclaimer.
 
44
 * 2. Redistributions in binary form must reproduce the above copyright
 
45
 *    notice, this list of conditions and the following disclaimer in the
 
46
 *    documentation and/or other materials provided with the distribution.
 
47
 * 3. Neither the name of the University nor the names of its contributors
 
48
 *    may be used to endorse or promote products derived from this software
 
49
 *    without specific prior written permission.
 
50
 *
 
51
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
52
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
53
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
54
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
55
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
56
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
57
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
58
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
59
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
60
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
61
 * SUCH DAMAGE.
 
62
 *
 
63
 */
 
64
 
 
65
#ifndef _NET_IF_H_
 
66
#define _NET_IF_H_
 
67
 
 
68
/*
 
69
 * Length of interface external name, including terminating '\0'.
 
70
 * Note: this is the same size as a generic device's external name.
 
71
 */
 
72
#define IF_NAMESIZE 16
 
73
 
 
74
struct if_nameindex {
 
75
        unsigned int    if_index;       /* 1, 2, ... */
 
76
        char            *if_name;       /* null terminated name: "le0", ... */
 
77
};
 
78
 
 
79
unsigned int if_nametoindex(const char *);
 
80
char *  if_indextoname(unsigned int, char *);
 
81
struct  if_nameindex * if_nameindex(void);
 
82
void    if_freenameindex(struct if_nameindex *);
 
83
 
 
84
#endif /* !_NET_IF_H_ */
 
85