[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bind redux



In:

http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9906/0304.html
http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9906/0313.html

I grumbled about consistent use of bind, so that OTcl and C++ users
can talk about the same variables and you don't have to go hunting for
the bind statement to see what maps to what when you're working across
the divide.

The thing is, once you start going a bit deeper into the ns code,
however reluctantly, there's a second level of confusion. A search on
'return ' in headers for member functions returning variables produces
rather similar results for bind; almost all are obvious and sensibly
mapped: blah() to blah_, but the odd thing like:

tcp.h:  int& flags() { return (tcp_flags_); }
rtp.h:  u_int16_t& flags() { return (flags_); }

(or
ip.h:   int& flowid() { return (fid_); }
address.h:      inline int portshift() {return PortShift_;}
address.h:      inline int portmask() {return PortMask_;}
packet.h:       inline double& timestamp() { return (ts_); }  )

can really throw you for a loop and complicate digging up responsible
bits of code affected by changes.

cheers,

L.

is having fun with flags in tracefiles.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>