[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ns] nsaddr_t
--
Free Dmitry Sklyarov !
http://www.freesklyarov.org
> -----Original Message-----
> From: Karthik Ramakrishnan [SMTP:[email protected]]
> Sent: Friday, September 07, 2001 1:39 AM
> To: [email protected]
> Subject: [ns] nsaddr_t
>
>
> HI,
>
> Could someone clarify the following for me?
> 1) What is the variable type of iph->src_ and iph->dst_ variable? ie the
> type for the sourse and destination addresses in the ip header.
>
> From my understanding ? it is of type "nsaddr_t" .
>
in config.h:
typedef int32_t nsaddr_t;
struct ns_addr_t {
int32_t addr_;
int32_t port_;
};
in ip.h:
struct hdr_ip {
...
ns_addr_t src_;
ns_addr_t dst_;
...
nsaddr_t saddr() {return src_.addr_;};
nsaddr_t daddr() { return dst_.addr_;};
Quite confusing that the only difference is a "_"
> 2) Also,the node id of a wireless node is also of type nsaddr_t (?)
>
Well, as you see, simply an int.
> 3). How can a node find its own ip address and node id , i am trying to use
> it in the code for a routing module.
>
the own ip address if you have the node id:
#define MY_IP Address::instance().get_nodeaddr(((MobileNode*)(netif_->node()))->address())
I use this inside the MAC layer.
Bye
Alex
P.S. outlook sucks