IP address call

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Author Message
piratesteve
DD-WRT Novice


Joined: 20 Feb 2012
Posts: 5

PostPosted: Wed Jun 20, 2012 0:01    Post subject: IP address call Reply with quote
Here's the situation:
I have a server and a client socket setup in a program (it's in C, more like a tool that can be compiled with source code) on the same router. The issue is, I can seem how to pull an IP address from memory... as in, I'm looking to access a table of IP addresses that my router is connected to, and be able to call that address to my socket setups (i know server doesn't need the IP address of the client it is talking to, but the client does). I'm using a gethostbyname() function, and I'm planning on passing the function the string of the IP address (e.x. instead of saying localhost I would like to be able to put in 127.0.0.1, which is a variable passed to my client socket creation process).

Simply put.... looking at this:

get an array of IP addresses that router is connected to
pick one of those addresses of which i'm connected to
client_socket_create(char[] IPaddr)

Any suggestions?
Sponsor
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum