[Ns-developers] About real-world application integration

Hajime Tazaki tazaki at sfc.wide.ad.jp
Thu Apr 2 09:10:27 PDT 2009


Hi Mathieu,

Now I try to make repo as you suggested,

>  - create a mercurial repo with only the patches you want to send me
>and I will pull from this repo, review, and push in mathieu/ns-3-simu


I added the modification in src/process-manager from my repo
(http://www.sfc.wide.ad.jp/~tazaki/hg/ns-3-simu_zebra_ipv6/),
but I include something from other directories,

 M src/node/node.cc
 M src/node/socket.cc
 M src/node/socket.h

and some blocks is covered with 
 #ifdef SIMU_NETLINK_IPV6
because it's heavily depend on ipv6 codes and netlink code.


For example,

src/process-manager/unix-socket-fd.cc

includes the following modification.

Address
UnixSocketFd::PosixAddressToNs3Address (const struct sockaddr *my_addr, socklen_t addrlen) const

 :
  else if (my_addr->sa_family == AF_NETLINK )
    {
      const struct sockaddr_nl *addr = (const struct sockaddr_nl *)my_addr;
      //user space netlink socket has a nozero process id
      uint32_t pid = addr->nl_pid ? addr->nl_pid : getpid();
      NetlinkSocketAddress nladdress = NetlinkSocketAddress(pid, addr->nl_groups);
      return nladdress;
    }
  else if (my_addr->sa_family == AF_INET6)
    {
      const struct sockaddr_in6 *addr = (const struct sockaddr_in6 *)my_addr;
      Ipv6Address ipv6;
      ipv6.Set ((uint8_t *)addr->sin6_addr.s6_addr);
      uint16_t port = ntohs (addr->sin6_port);
      Inet6SocketAddress inet = Inet6SocketAddress (ipv6, port);
      return inet;
    }


NetlinkSocketAddress is in netlink-socket.cc, but this time,
I didn't include this netlink stuff into this repo. 

Do you think it's better to include src/node/netlink-* into
ns-3-simu?


You can find all of my modification with a little comments at

http://www.sfc.wide.ad.jp/~tazaki/hg/ns-3-simu-mod/


#This is the first step, see you soon.

regards,
hajime



More information about the Ns-developers mailing list