partysip-dev
[Top][All Lists]
Advanced

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

Re: [Partysip-dev] IPv6


From: Aymeric Moizard
Subject: Re: [Partysip-dev] IPv6
Date: Fri, 11 Apr 2003 13:25:00 +0200 (CEST)

Back with some questions:

I merge your patch and compiled it successfully.

Here are some comments:

1:
 The automatic detection of IP is broken:
 PPL_DECLARE (int) ppl_dns_get_local_fqdn (char **servername,
                                           char **serverip,
                                           char **netmask,
                                           char *interface,
                                           unsigned int pos_interface)

 char *ppl_dns_default_gateway ();

The above methods have completely changed since I've created the
file ppldnsv6.c. Can you replace the deprecated one in ppldnsv6.c
with those in ppldns.c and then test the automatic detection of
ip addresses again (comment the "serverip" line in partysip6.conf)?
It can be great to make it work for ipv6.

2:
Watching at the udp plugin, it seems the actual code
for IPv6 won't work anymore for IPv4... This is
because the code assume you are using IPv6 addresses:

#ifdef IPV6_SUPPORT
  ctx->in_socket = ppl_socket (PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
#else
  ctx->in_socket = ppl_socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP);
#endif

or:

#ifdef IPV6_SUPPORT
          raddr.sin6_addr = in6addr_any;
          raddr.sin6_port = htons ((short) ctx->out_port);
          raddr.sin6_family = AF_INET6;
#else
          raddr.sin_addr.s_addr = htons (INADDR_ANY);
          raddr.sin_port = htons ((short) ctx->out_port);
          raddr.sin_family = AF_INET;
#endif

If would find it great to fix this. I think the best
way is to use "getaddrinfo" which actually prepare
all informations to create the socket. It should look
like:

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = PF_UNSPEC;  /* ?? */
    hints.ai_socktype = SOCK_DGRAM;
    hints.ai_flags = AI_NUMERICHOST | AI_PASSIVE; /* ?? */
    i = getaddrinfo(Address, 5060, &hints, &addrinfo);

    if ((addrinfo->ai_family!=PF_INET)&&(addrinfo->ai_family!=PF_INET6))
         return -1;  /* protocol not supported */

    socket = socket(addrinfo->ai_family,
                    addrinfo->ai_socktype,
                    addrinfo->ai_protocol);
    bind(socket, addrinfo->ai_addr, addrinfo->ai_addrlen);

    freeaddrinfo(addrinfo);

I hope you can fix this!
Thanks

Aymeric

On Fri, 11 Apr 2003, Aymeric Moizard wrote:

>
> On 11 Apr 2003, Anthony Liu wrote:
>
> > Hi,
> >
> > The patch is attached. Note the following please:
>
> Great thanks.
> I'll test it today for IPv4
>
> > 4.Modification of NAT module is not finished since
> >   it is more complex than my expectation.
>
> Quite all NAT issue are manage in file src/psp_nat.c
>
> The "dynamic" NAT config use a modified version of iptables
> which listen for new rules on a TCP socket. The modified
> version of iptables can be donwloaded on
> http:/osip.atosc.org/download/
>
> The non "dynamic" NAT is just masquerading some feilds
> in SIP messages (SDP info, Via and
>
> remote_natip   = sip.no-ip.org
> masquerade_via = on          (<- not needed for compliant remote proxy/UA)
> masquerade_sdp = on          (<- always needed, but you also have to
>                                  enter a static rule in the firewall to
>                                  forward RTP streams. There should be
>                                  at least one rule for each UA on the
>                                  LAN. All the UA in this LAN MUST be
>                                  configured to use different RTP port.)
>
> In all cases, you MUST choose to "record-route" request by
> selecting:
>
>   record-route  on
>
> evrywhere it appears in the configuration.
>
> > 5.sip.mcast.net has NO WELL-KNOWN IPv6 address...so
> >   the behavior is unknown for codes in that block...
>
> Fine.
>
> > 6.IPv4 functions are not tested after IPv6 modification
> >   is done. (I've tested IPv6 functions with two kphone
> >   clients)
> >
> > That's what I can recall so far... If something comes
> > back to my mind, I'll let you know.
> >
> > My next step is to add a new module whose function might
> > overlap with NAT partially... Can you give me a note on
> > the module programming in partysip?
>
> For the NAT issues, the explanations are above.
>
> Are you asking information on the plugin developpement?
> Aymeric
>
> > Regards,
> > Anthony
> >
> > ?b ?g?T, 2003-04-09 00:15, Aymeric Moizard ?g?D?G
> > >
> > > osip should support IPv6 messages. I've only tested the parser
> > > but it should have no impact on the fsm side.
> > >
> > > To test it, you can edit the file conf/torture_msgs and write
> > > IPv6 messages. Then you simply execute
> > >
> > > ./test/torture_test conf/torture_msgs 0 -v -c
> > >
> > > The above will test the first message in the file conf/torture_msgs.
> > >
> > > Thanks for working on IPv6/partysip!
> > > Aymeric
> > >
> > > On 8 Apr 2003, Anthony Liu wrote:
> > >
> > > > Thanks for your guide. I'm working on it now. The copy of source
> > > > code was checked out this morning from cvs. Though I have not
> > > > finished my modification. I wonder can osip support IPv6 message
> > > > parsing? The primary difference I found when I modify kphone 3.0
> > > > is the SIP URI format. For example, a typical SIP URI looks like:
> > > >
> > > > address@hidden:5060
> > > >
> > > > It happens all the time that the hostport part will be denoted
> > > > in dot-quad form under IPv4:
> > > >
> > > > address@hidden:5060
> > > >
> > > > For IPv6 addresses, it somehow looks like this:
> > > >
> > > > address@hidden:b80:1c67:1:20c:6eff:fe00:c46]:5060
> > > >
> > > > or, according to the ABNF defined in RFC 3261:
> > > >
> > > > address@hidden:b80:1c67:1:20c:6eff:fe00:c46:192.168.1.1]:5060
> > > >
> > > > if both IPv4 and IPv6 addresses exist. Can osip handle these
> > > > URIs correctly?
> > > >
> > > > Regards,
> > > > Anthony Liu
> > > >
> > > > ?b ?g?@, 2003-04-07 20:19, Aymeric Moizard ?g?D?G
> > > > >
> > > > > I've been preparing IPv6 for a while now.
> > > > > The file ppl/unix/ppldnsv6.c makes use of
> > > > > getaddrinfo to manage transparently ipv4/ipv6
> > > > > address.
> > > > >
> > > > > To use this file instead of the original one,
> > > > > you have to compile with -DHAVE_GETADDRINFO
> > > > >
> > > > > CFLAGS="-DHAVE_GETADDRINFO" ./configure
> > > > > make
> > > > > make install
> > > > >
> > > > > The above should already work for IPv4.
> > > > >
> > > > > If you want to really use an IPv6 network (which I've never 
> > > > > tried...), use
> > > > > the additionnal flag "-DIPV6_SUPPORT":
> > > > >
> > > > > CFLAGS="-DHAVE_GETADDRINFO" ./configure
> > > > > make
> > > > > make install
> > > > >
> > > > > To make it work this way, I guess you have to change
> > > > > some code in other places... This include calls to
> > > > > methods like inet_addr() that appears evrywhere.
> > > > > Some method to replace them are already in partysip
> > > > > (like ppl_inet_ntop() that makes use of inet_ntop)
> > > > >
> > > > > I'll apreciate if you can make a patch for IPv6.
> > > > > My request is that you'll have to enclose all
> > > > > your change between:
> > > > >
> > > > > #ifdef IPV6_SUPPORT
> > > > > ...
> > > > > #else
> > > > > ...
> > > > > #endif
> > > > >
> > > > > so that it won't break anything until the patch
> > > > > will be complete.
> > > > >
> > > > > You'll mainly have to work on the udp plugin
> > > > > (in the plugin/udp directory) and in the file
> > > > > src/sfp.c which may be already ok.
> > > > >
> > > > >
> > > > > Thanks
> > > > > Aymeric
> > > > >
> > > > > On 7 Apr 2003, Anthony Liu wrote:
> > > > >
> > > > > > I need to (have to) modfiy partysip to support IPv6.
> > > > > > However, the document available is very limited at this time.
> > > > > > I've read source code for a while but haven't figure out a
> > > > > > better way to do it. Can you suggest, please?
> > > > > >
> > > > > > Regards,
> > > > > > Anthony Liu
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > _______________________________________________
> > > > > > Partysip-dev mailing list
> > > > > > address@hidden
> > > > > > http://mail.nongnu.org/mailman/listinfo/partysip-dev
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Partysip-dev mailing list
> > > > address@hidden
> > > > http://mail.nongnu.org/mailman/listinfo/partysip-dev
> > > >
> >
> >
>
>
>
> _______________________________________________
> Partysip-dev mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/partysip-dev
>







reply via email to

[Prev in Thread] Current Thread [Next in Thread]