Tech Support > Microsoft Windows > Development Resources > API for Dial-Up (RAS????)
API for Dial-Up (RAS????)
Posted by Falcon on December 1st, 2003


Hi All,

This group is my last hope, I am aware of the RAS API that allows the
establishment of a DUN connection. I understand that this API creates
phonebook entries and will make calls based on those entries.

What I do not understand is that once you have a connection
established, how do you send and receive data on the PPP
connection!!!!!

Such that RasDial returns a handle to the connection if successful,
can this handle be used with Winsock API (send & receive) or must I
use some other API with this handle?

I have been searching all manner of groups for the answer, and found
nothing.

Please help :-)
Falcon

Posted by bunny on December 1st, 2003


Falcon wrote:
Generally you use winsock.

You dont need the handle to use winsock, use WSAStartup, socket, send,
recv, WSACleanup as you would with any other type of network connection.


Posted by Falcon on December 2nd, 2003


bunny <xbunny@eidosnet.co.uk> wrote in message news:<AxKyb.407$Am5.302@news-binary.blueyonder.co.uk>...
Thanks Bunny,

Just to follow on from what you have already stated above. If using
Winsock, will I need to know the Destination IP address. Or by default
will the send or recv use the PPP link established by RAS.

Cheers,
Ginger

Posted by verga on December 2nd, 2003


On 2 Dec 2003 09:21:14 -0800, gingerfalcon@yahoo.co.uk (Falcon) wrote:
If you're after establishing a TCP/IP connection, you don't need to worry about
anything RAS or PPP -- once the dial-up connection to your ISP is established. From
that point on, you are part of a regular IP network and, whatever you program is no
different from your good old socket IP programming on a local net. You'll need a target
IP address and a port to connect somewhere, of course, but that's regular socket
programming. Your data, when sent via a socket, will, of course, be packaged for the
phone transmission (PPP etc.), but all of this is hidden from you, you don't have to
worry about anything, just open a socket, connect somewhere, start pumping data. A
dial-up connection will be noticeably slower that some kind of direct network hook-up,
but that doesn't affect your programming. You only need RAS to connect your modem to
your ISP's modem, once that's happened, RAS is -- programmatically -- out of the
picture. You only return to it when you need to tear the phone connection down (or get
some connection-related statistics, should you need something like that.)






Posted by bunny on December 2nd, 2003


Falcon wrote:

You will need to know the IP address and port of the destination that
you wish to connect to. Packets will be sent to that address via
whatever routes are setup on your computers routing table. There are
API's to query the network configuration such that you could learn the
IP address of the remote end of the PPP link but Im afraid I cant
remember what they are as I have never needed to use them.


Posted by Falcon on December 3rd, 2003


Thanks for your insight Bunny, but I have a further question.

I wish to send UDP datagrams across the PPP RAS link, to do this I
will need to know the IP address of the destination. How would I do
this?

Also, will the creation of a socket automatically use the PPP link by
default?

I hope these questions are sensible ones and I am not wasting your
time.

Thanks,
Ginger

Posted by bunny on December 3rd, 2003


Falcon wrote:
The IP helper API can be used to find out the IP addresses of the ends
of a PPP connection. (and a lot of other gory network details too)

http://msdn.microsoft.com/library/de...start_page.asp

(the URL may come out wrapped it should all be one line above)

It will use a route as defined by your computers routing table (run the
command 'route print' to see it). If you connect to the IP address of
the remote PPP server then it will use the PPP link.

No problem, glad to help. Im still not quite sure what you are doing
though. Usually you dont want to send data to the server on the end of a
PPP link, you want to send to some server on the internet. Provided the
PPP server connects onwards to the internet and the PPP link is setup
correctly then it all happens automatically and you dont need to concern
yourself with the PPP server.