[Ns-developers] Status ns-3 quagga porting of last week
Liu Jian
liujatp at gmail.com
Mon Jun 9 00:43:51 PDT 2008
hi all,
last week, i implemented a class NetlinkMessage(netlink-msg.h/.cc), which
contains messages Netlinksocket to send/recv. it has a common structue:
class NetlinkMessage
{
NetlinkMessageHeader;
ServiceMessage;
ServiceAttributes;
...//other modules
}
the all members were subclass of Header for its serialize/desiralize for NS3
kernel.
For testing(example/simple-netlink-socket.cc), i build some different types of
messages as the realworld application: GET,NEW,Multipart,etc.now the
netlinkmessage can be add/remove at Packet with right values for socket's
operation.
But the orignal serialize()/deserialize() of Header class were not useful for
NetlinkMessage. instead, i add new functions for my work.changes from:
void Serialize (Buffer::Iterator start) const;
uint32_t Deserialize (Buffer::Iterator start);
to:
void Serialize_ (Buffer::Iterator&start) const;
uint32_t Deserialize_ (Buffer::Iterator&start);
so the new functions can finish it well.
void Serialize_ (Buffer::Iterator&start) const
{
NetlinkMessageHeader.Serialize_(&start);
ServiceMessage.Serialize_(&start);
ServiceAttributes.Serialize_(&start);
}
here, as my experience, the (Buffer::Iterator&start) would useful for the future
work especially if one member of the header type is still a header type.
Next work:
1, implement the netlink err-message in NetlinkMessage.
2, read kernel code, let the NetlinkSocket do the write parsing job.
Liu Jian
2008-06-09
More information about the Ns-developers
mailing list