> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Matthias Budde > > I am wondering which addresses are reserved in ns-2. I know > that -1 is "IP_BROADCAST" but what else? I use an Agent that > sends packets to daddr -2. Does anyone know what that stands > for? Are other adresses also reserved and is there a complete > list somewhere?
A very good question indeed. I've put some info about addresses here: http://tagus.inesc-id.pt/~pestrela/ns2/ns2_haddr_tips.html#_Toc121548871 -1 is commonly used for IP_BROADCAST, but also for "unk", and also for "error" (in different parts of the code) -2: normally stands for "unk" when "-1" is already "error", eg: [EMAIL PROTECTED]:[ns2]$ grep -d recurse "IP_BROCAST" * common/ip.h:#define IP_BROADCAST ((u_int32_t) 0xffffffff) common/packet.h: (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST common/packet.h: (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST [EMAIL PROTECTED]:[ns2]$ grep -d recurse "\-1" * | grep define cims/timip.h:#define ID_UNK -1 diffserv/dsPolicy.h:#define ANY_HOST -1 // Add to enable point to diffserv/ew.h:#define EW_UNCHANGE -1 diffusion3/apps/gear/geo-tools.hh:#define FAIL -1 diffusion3/apps/gear/geo-tools.hh:#define INITIAL_HEURISTIC_VALUE -1 diffusion3/apps/sysfilters/gradient.hh:#define OLD_MESSAGE -1 diffusion3/lib/dr.hh:#define WAIT_FOREVER -1 diffusion3/lib/main/header.hh:#define BROADCAST_ADDR -1 diffusion3/lib/nr/nr.hh:#define FAIL -1 mac/mac-802_3.h:#define INVALID_UID -1 // Used for mac level traces mac/mac-802_3.h:#define INVALID_TIME -1 mac/mac-tdma.h:#define FIRST_ROUND -1 mac/mac.h:#define BCAST_ADDR -1 mcast/lms.h:#define LMS_NOADDR -1 mcast/lms.h:#define LMS_NOPORT -1 mcast/srm-topo.h:#define SRM_NOIF -1 [EMAIL PROTECTED]:[ns2]$ grep -d recurse "\-2" * | grep define mac/mac-tdma.h:#define NOTHING_TO_SEND -2 (this is a partial list of all places that use -1 or -2 as addresses)