diff options
author | Nathan Binkert <nate@binkert.org> | 2009-03-17 12:49:03 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-03-17 12:49:03 -0700 |
commit | a102f845404461bb3dade04fe3cdc754949bd248 (patch) | |
tree | 00db8cd096009d287ef796f95b2a9221bdb63416 /ext/dnet/intf.h | |
parent | f3621f11d5fe19557984e5554983a69bb89fb8a2 (diff) | |
download | gem5-a102f845404461bb3dade04fe3cdc754949bd248.tar.xz |
includes: add ext to the includes path.
move dnet to the correct place so that we use this
--HG--
rename : ext/dnet/dnet/addr.h => ext/dnet/addr.h
rename : ext/dnet/dnet/arp.h => ext/dnet/arp.h
rename : ext/dnet/dnet/blob.h => ext/dnet/blob.h
rename : ext/dnet/dnet/eth.h => ext/dnet/eth.h
rename : ext/dnet/dnet/fw.h => ext/dnet/fw.h
rename : ext/dnet/dnet/icmp.h => ext/dnet/icmp.h
rename : ext/dnet/dnet/intf.h => ext/dnet/intf.h
rename : ext/dnet/dnet/ip.h => ext/dnet/ip.h
rename : ext/dnet/dnet/ip6.h => ext/dnet/ip6.h
rename : ext/dnet/dnet/os.h => ext/dnet/os.h
rename : ext/dnet/dnet/rand.h => ext/dnet/rand.h
rename : ext/dnet/dnet/route.h => ext/dnet/route.h
rename : ext/dnet/dnet/tcp.h => ext/dnet/tcp.h
rename : ext/dnet/dnet/udp.h => ext/dnet/udp.h
Diffstat (limited to 'ext/dnet/intf.h')
-rw-r--r-- | ext/dnet/intf.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/ext/dnet/intf.h b/ext/dnet/intf.h new file mode 100644 index 000000000..38acd4356 --- /dev/null +++ b/ext/dnet/intf.h @@ -0,0 +1,68 @@ +/* + * intf.c + * + * Network interface operations. + * + * Copyright (c) 2000 Dug Song <dugsong@monkey.org> + * + * $Id: intf.h,v 1.16 2004/01/13 07:41:09 dugsong Exp $ + */ + +#ifndef DNET_INTF_H +#define DNET_INTF_H + +/* + * Interface entry + */ +#define INTF_NAME_LEN 16 + +struct intf_entry { + u_int intf_len; /* length of entry */ + char intf_name[INTF_NAME_LEN]; /* interface name */ + u_short intf_type; /* interface type (r/o) */ + u_short intf_flags; /* interface flags */ + u_int intf_mtu; /* interface MTU */ + struct addr intf_addr; /* interface address */ + struct addr intf_dst_addr; /* point-to-point dst */ + struct addr intf_link_addr; /* link-layer address */ + u_int intf_alias_num; /* number of aliases */ + struct addr intf_alias_addrs __flexarr; /* array of aliases */ +}; + +/* + * MIB-II interface types - http://www.iana.org/assignments/ianaiftype-mib + */ +#define INTF_TYPE_OTHER 1 /* other */ +#define INTF_TYPE_ETH 6 /* Ethernet */ +#define INTF_TYPE_TOKENRING 9 /* Token Ring */ +#define INTF_TYPE_FDDI 15 /* FDDI */ +#define INTF_TYPE_PPP 23 /* Point-to-Point Protocol */ +#define INTF_TYPE_LOOPBACK 24 /* software loopback */ +#define INTF_TYPE_SLIP 28 /* Serial Line Interface Protocol */ +#define INTF_TYPE_TUN 53 /* proprietary virtual/internal */ + +/* + * Interface flags + */ +#define INTF_FLAG_UP 0x01 /* enable interface */ +#define INTF_FLAG_LOOPBACK 0x02 /* is a loopback net (r/o) */ +#define INTF_FLAG_POINTOPOINT 0x04 /* point-to-point link (r/o) */ +#define INTF_FLAG_NOARP 0x08 /* disable ARP */ +#define INTF_FLAG_BROADCAST 0x10 /* supports broadcast (r/o) */ +#define INTF_FLAG_MULTICAST 0x20 /* supports multicast (r/o) */ + +typedef struct intf_handle intf_t; + +typedef int (*intf_handler)(const struct intf_entry *entry, void *arg); + +__BEGIN_DECLS +intf_t *intf_open(void); +int intf_get(intf_t *i, struct intf_entry *entry); +int intf_get_src(intf_t *i, struct intf_entry *entry, struct addr *src); +int intf_get_dst(intf_t *i, struct intf_entry *entry, struct addr *dst); +int intf_set(intf_t *i, const struct intf_entry *entry); +int intf_loop(intf_t *i, intf_handler callback, void *arg); +intf_t *intf_close(intf_t *i); +__END_DECLS + +#endif /* DNET_INTF_H */ |