IP address - PPP

This is a discussion on IP address - PPP ; Hi, I start a ppp connection from my modem to a RAS server. The RAS server have an IP address and give me a IP address. I need to read, from a my C application the IP of the RAS. ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: IP address

  1. IP address

    Hi,
    I start a ppp connection from my modem to a RAS server.
    The RAS server have an IP address and give me a IP address.
    I need to read, from a my C application the IP of the RAS.
    How can I do it ?
    Thank you in advance



  2. Re: IP address

    "Gio67" writes:
    > I start a ppp connection from my modem to a RAS server.
    > The RAS server have an IP address and give me a IP address.
    > I need to read, from a my C application the IP of the RAS.
    > How can I do it ?


    It depends on your operating system.

    Typically, you read out interface addresses using the BSD sockets
    ioctls -- in particular, SIOCGIFCONF and SIOCGIFADDR.

    It may be different on Windows systems; I have no way to tell.

    --
    James Carlson, KISS Network
    Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

  3. Re: IP address


    "James Carlson" ha scritto nel messaggio
    news:xoav64rks1sc.fsf@sun.com...
    > "Gio67" writes:
    > > I start a ppp connection from my modem to a RAS server.
    > > The RAS server have an IP address and give me a IP address.
    > > I need to read, from a my C application the IP of the RAS.
    > > How can I do it ?

    >
    > It depends on your operating system.
    >
    > Typically, you read out interface addresses using the BSD sockets
    > ioctls -- in particular, SIOCGIFCONF and SIOCGIFADDR.
    >
    > It may be different on Windows systems; I have no way to tell.
    >
    > --
    > James Carlson, KISS Network
    > Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    > MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677


    Thank you.
    I use linux kernel 2.6.x, then I have to open the /dev/ppp0 device and then
    make ioctl (SIOCGIFCONF ....)
    It' s right ?
    Do you have an example of that ?
    Bye



  4. Re: IP address

    [Please don't both post and send me email. Pick one.]

    "Gio67" writes:
    > I use linux kernel 2.6.x, then I have to open the /dev/ppp0 device and then
    > make ioctl (SIOCGIFCONF ....)
    > It' s right ?


    No. Applications should not be fooling around with network device
    nodes unless they have a need to do so. And network device nodes know
    _nothing_ of what IP is doing or how IP is configured.

    The common SIOCGIFCONF ioctl is a BSD sockets ioctl. This means that
    it works on a socket. Create a socket (just a simple UDP one will do)
    by calling the socket() function, and issue the ioctl on that.

    > Do you have an example of that ?


    Search the web. There are hundreds or thousands of them.

    --
    James Carlson, KISS Network
    Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

+ Reply to Thread