changeset 7e310503019e in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=7e310503019e description: includes: add ext to the includes path. move dnet to the correct place so that we use this
diffstat: 30 files changed, 1738 insertions(+), 1738 deletions(-) SConstruct | 4 ext/dnet/addr.h | 67 ++++++ ext/dnet/arp.h | 103 +++++++++ ext/dnet/blob.h | 56 +++++ ext/dnet/dnet/addr.h | 67 ------ ext/dnet/dnet/arp.h | 103 --------- ext/dnet/dnet/blob.h | 56 ----- ext/dnet/dnet/eth.h | 77 ------- ext/dnet/dnet/fw.h | 54 ----- ext/dnet/dnet/icmp.h | 265 ------------------------- ext/dnet/dnet/intf.h | 68 ------ ext/dnet/dnet/ip.h | 487 ----------------------------------------------- ext/dnet/dnet/ip6.h | 183 ----------------- ext/dnet/dnet/os.h | 117 ----------- ext/dnet/dnet/rand.h | 33 --- ext/dnet/dnet/route.h | 35 --- ext/dnet/dnet/tcp.h | 158 --------------- ext/dnet/dnet/udp.h | 32 --- ext/dnet/eth.h | 77 +++++++ ext/dnet/fw.h | 54 +++++ ext/dnet/icmp.h | 265 +++++++++++++++++++++++++ ext/dnet/intf.h | 68 ++++++ ext/dnet/ip.h | 487 +++++++++++++++++++++++++++++++++++++++++++++++ ext/dnet/ip6.h | 183 +++++++++++++++++ ext/dnet/os.h | 117 +++++++++++ ext/dnet/rand.h | 33 +++ ext/dnet/route.h | 35 +++ ext/dnet/tcp.h | 158 +++++++++++++++ ext/dnet/udp.h | 32 +++ ext/gzstream/SConscript | 2 diffs (truncated from 3615 to 300 lines): diff -r 9116be67b6d8 -r 7e310503019e SConstruct --- a/SConstruct Tue Mar 17 12:45:41 2009 -0700 +++ b/SConstruct Tue Mar 17 12:49:03 2009 -0700 @@ -373,6 +373,9 @@ Export('base_dir') Export('extras_dir_list') +# the ext directory should be on the #includes path +env.Append(CPPPATH=[Dir('ext')]) + # M5_PLY is used by isa_parser.py to find the PLY package. env.Append(ENV = { 'M5_PLY' : Dir('ext/ply').abspath }) @@ -418,7 +421,6 @@ if sys.platform == 'cygwin': # cygwin has some header file issues... env.Append(CCFLAGS=Split("-Wno-uninitialized")) -env.Append(CPPPATH=[Dir('ext/dnet')]) # Check for SWIG if not env.has_key('SWIG'): diff -r 9116be67b6d8 -r 7e310503019e ext/dnet/addr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ext/dnet/addr.h Tue Mar 17 12:49:03 2009 -0700 @@ -0,0 +1,67 @@ +/* + * addr.h + * + * Network address operations. + * + * Copyright (c) 2000 Dug Song <dugs...@monkey.org> + * + * $Id: addr.h,v 1.12 2003/02/27 03:44:55 dugsong Exp $ + */ + +#ifndef DNET_ADDR_H +#define DNET_ADDR_H + +#define ADDR_TYPE_NONE 0 /* No address set */ +#define ADDR_TYPE_ETH 1 /* Ethernet */ +#define ADDR_TYPE_IP 2 /* Internet Protocol v4 */ +#define ADDR_TYPE_IP6 3 /* Internet Protocol v6 */ + +struct addr { + uint16_t addr_type; + uint16_t addr_bits; + union { + eth_addr_t __eth; + ip_addr_t __ip; + ip6_addr_t __ip6; + + uint8_t __data8[16]; + uint16_t __data16[8]; + uint32_t __data32[4]; + } __addr_u; +}; +#define addr_eth __addr_u.__eth +#define addr_ip __addr_u.__ip +#define addr_ip6 __addr_u.__ip6 +#define addr_data8 __addr_u.__data8 +#define addr_data16 __addr_u.__data16 +#define addr_data32 __addr_u.__data32 + +#define addr_pack(addr, type, bits, data, len) do { \ + (addr)->addr_type = type; \ + (addr)->addr_bits = bits; \ + memmove((addr)->addr_data8, (char *)data, len); \ +} while (0) + +__BEGIN_DECLS +int addr_cmp(const struct addr *a, const struct addr *b); + +int addr_bcast(const struct addr *a, struct addr *b); +int addr_net(const struct addr *a, struct addr *b); + +char *addr_ntop(const struct addr *src, char *dst, size_t size); +int addr_pton(const char *src, struct addr *dst); + +char *addr_ntoa(const struct addr *a); +#define addr_aton addr_pton + +int addr_ntos(const struct addr *a, struct sockaddr *sa); +int addr_ston(const struct sockaddr *sa, struct addr *a); + +int addr_btos(uint16_t bits, struct sockaddr *sa); +int addr_stob(const struct sockaddr *sa, uint16_t *bits); + +int addr_btom(uint16_t bits, void *mask, size_t size); +int addr_mtob(const void *mask, size_t size, uint16_t *bits); +__END_DECLS + +#endif /* DNET_ADDR_H */ diff -r 9116be67b6d8 -r 7e310503019e ext/dnet/arp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ext/dnet/arp.h Tue Mar 17 12:49:03 2009 -0700 @@ -0,0 +1,103 @@ +/* + * arp.h + * + * Address Resolution Protocol. + * RFC 826 + * + * Copyright (c) 2000 Dug Song <dugs...@monkey.org> + * + * $Id: arp.h,v 1.12 2003/03/16 17:39:17 dugsong Exp $ + */ + +#ifndef DNET_ARP_H +#define DNET_ARP_H + +#define ARP_HDR_LEN 8 /* base ARP header length */ +#define ARP_ETHIP_LEN 20 /* base ARP message length */ + +#ifndef __GNUC__ +# define __attribute__(x) +# pragma pack(1) +#endif + +/* + * ARP header + */ +struct arp_hdr { + uint16_t ar_hrd; /* format of hardware address */ + uint16_t ar_pro; /* format of protocol address */ + uint8_t ar_hln; /* length of hardware address (ETH_ADDR_LEN) */ + uint8_t ar_pln; /* length of protocol address (IP_ADDR_LEN) */ + uint16_t ar_op; /* operation */ +}; + +/* + * Hardware address format + */ +#define ARP_HRD_ETH 0x0001 /* ethernet hardware */ +#define ARP_HRD_IEEE802 0x0006 /* IEEE 802 hardware */ + +/* + * Protocol address format + */ +#define ARP_PRO_IP 0x0800 /* IP protocol */ + +/* + * ARP operation + */ +#define ARP_OP_REQUEST 1 /* request to resolve ha given pa */ +#define ARP_OP_REPLY 2 /* response giving hardware address */ +#define ARP_OP_REVREQUEST 3 /* request to resolve pa given ha */ +#define ARP_OP_REVREPLY 4 /* response giving protocol address */ + +/* + * Ethernet/IP ARP message + */ +struct arp_ethip { + uint8_t ar_sha[ETH_ADDR_LEN]; /* sender hardware address */ + uint8_t ar_spa[IP_ADDR_LEN]; /* sender protocol address */ + uint8_t ar_tha[ETH_ADDR_LEN]; /* target hardware address */ + uint8_t ar_tpa[IP_ADDR_LEN]; /* target protocol address */ +}; + +/* + * ARP cache entry + */ +struct arp_entry { + struct addr arp_pa; /* protocol address */ + struct addr arp_ha; /* hardware address */ +}; + +#ifndef __GNUC__ +# pragma pack() +#endif + +#define arp_pack_hdr_ethip(hdr, op, sha, spa, tha, tpa) do { \ + struct arp_hdr *pack_arp_p = (struct arp_hdr *)(hdr); \ + struct arp_ethip *pack_ethip_p = (struct arp_ethip *) \ + ((uint8_t *)(hdr) + ARP_HDR_LEN); \ + pack_arp_p->ar_hrd = htons(ARP_HRD_ETH); \ + pack_arp_p->ar_pro = htons(ARP_PRO_IP); \ + pack_arp_p->ar_hln = ETH_ADDR_LEN; \ + pack_arp_p->ar_pln = IP_ADDR_LEN; \ + pack_arp_p->ar_op = htons(op); \ + memmove(pack_ethip_p->ar_sha, &(sha), ETH_ADDR_LEN); \ + memmove(pack_ethip_p->ar_spa, &(spa), IP_ADDR_LEN); \ + memmove(pack_ethip_p->ar_tha, &(tha), ETH_ADDR_LEN); \ + memmove(pack_ethip_p->ar_tpa, &(tpa), IP_ADDR_LEN); \ +} while (0) + +typedef struct arp_handle arp_t; + +typedef int (*arp_handler)(const struct arp_entry *entry, void *arg); + +__BEGIN_DECLS +arp_t *arp_open(void); +int arp_add(arp_t *arp, const struct arp_entry *entry); +int arp_delete(arp_t *arp, const struct arp_entry *entry); +int arp_get(arp_t *arp, struct arp_entry *entry); +int arp_loop(arp_t *arp, arp_handler callback, void *arg); +arp_t *arp_close(arp_t *arp); +__END_DECLS + +#endif /* DNET_ARP_H */ diff -r 9116be67b6d8 -r 7e310503019e ext/dnet/blob.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ext/dnet/blob.h Tue Mar 17 12:49:03 2009 -0700 @@ -0,0 +1,56 @@ +/* + * blob.h + * + * Binary blob handling. + * + * Copyright (c) 2002 Dug Song <dugs...@monkey.org> + * + * $Id: blob.h,v 1.2 2002/04/05 03:06:44 dugsong Exp $ + */ + +#ifndef DNET_BLOB_H +#define DNET_BLOB_H + +typedef struct blob { + u_char *base; /* start of data */ + int off; /* offset into data */ + int end; /* end of data */ + int size; /* size of allocation */ +} blob_t; + +__BEGIN_DECLS +blob_t *blob_new(void); + +int blob_read(blob_t *b, void *buf, int len); +int blob_write(blob_t *b, const void *buf, int len); + +int blob_seek(blob_t *b, int off, int whence); +#define blob_skip(b, l) blob_seek(b, l, SEEK_CUR) +#define blob_rewind(b) blob_seek(b, 0, SEEK_SET) + +#define blob_offset(b) ((b)->off) +#define blob_left(b) ((b)->end - (b)->off) + +int blob_index(blob_t *b, const void *buf, int len); +int blob_rindex(blob_t *b, const void *buf, int len); + +int blob_pack(blob_t *b, const char *fmt, ...); +int blob_unpack(blob_t *b, const char *fmt, ...); + +int blob_insert(blob_t *b, const void *buf, int len); +int blob_delete(blob_t *b, void *buf, int len); + +int blob_print(blob_t *b, char *style, int len); + +blob_t *blob_free(blob_t *b); + +int blob_register_alloc(size_t size, void *(*bmalloc)(size_t), + void (*bfree)(void *), void *(*brealloc)(void *, size_t)); +#ifdef va_start +typedef int (*blob_fmt_cb)(int pack, int len, blob_t *b, va_list *arg); + +int blob_register_pack(char c, blob_fmt_cb fmt_cb); +#endif +__END_DECLS + +#endif /* DNET_BLOB_H */ diff -r 9116be67b6d8 -r 7e310503019e ext/dnet/dnet/addr.h --- a/ext/dnet/dnet/addr.h Tue Mar 17 12:45:41 2009 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* - * addr.h - * - * Network address operations. - * - * Copyright (c) 2000 Dug Song <dugs...@monkey.org> - * - * $Id: addr.h,v 1.12 2003/02/27 03:44:55 dugsong Exp $ - */ - -#ifndef DNET_ADDR_H -#define DNET_ADDR_H - -#define ADDR_TYPE_NONE 0 /* No address set */ -#define ADDR_TYPE_ETH 1 /* Ethernet */ -#define ADDR_TYPE_IP 2 /* Internet Protocol v4 */ -#define ADDR_TYPE_IP6 3 /* Internet Protocol v6 */ - -struct addr { - uint16_t addr_type; - uint16_t addr_bits; - union { - eth_addr_t __eth; - ip_addr_t __ip; - ip6_addr_t __ip6; - - uint8_t __data8[16]; - uint16_t __data16[8]; - uint32_t __data32[4]; - } __addr_u; -}; -#define addr_eth __addr_u.__eth -#define addr_ip __addr_u.__ip -#define addr_ip6 __addr_u.__ip6 -#define addr_data8 __addr_u.__data8 -#define addr_data16 __addr_u.__data16 -#define addr_data32 __addr_u.__data32 _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev