public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* GETHOSTBYNAME()
@ 2003-03-24  4:18 shesha bhushan
  2003-03-24  4:55 ` GETHOSTBYNAME() Prasad
  2003-03-24  9:23 ` GETHOSTBYNAME() Martin Mares
  0 siblings, 2 replies; 5+ messages in thread
From: shesha bhushan @ 2003-03-24  4:18 UTC (permalink / raw)
  To: linux-kernel, kernelnewbies

Hi All
I am trying to find the gethostbyname() equivalent function in kernel space. 
Does any one know that.
The reason is...
I am using UDP to transfer data from one machine to another. It is not one 
time transfer. Once I get a message from machine A; I need to send some 
message back to Machine A from Machine B. For that I was using the following 
lines in user space program. I need to do the same in kernel space. Could 
any one help me out in this.

struct hostent *data;
struct sockaddr_in server;
int sock;

  sock = socket(AF_INET, SOCK_DGRAM , 0)

/* binding and all are done here */

  data = gethostbyname("158.168.1.1");
  memcpy (&server.sin_addrs, data->h_addr, data->h_length);
  retval = sendto(sock,msg,sizeof(msg), 0, (struct sockaddr *) &server, 
sizeof server);


Thanking You
Shesha

_________________________________________________________________
Cricket - World Cup 2003 http://server1.msn.co.in/msnspecials/worldcup03/ 
News, Views and Match Reports.


^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <F64RsqSoQHK3gSkQsfl0000279b@hotmail.com>]

end of thread, other threads:[~2003-03-24  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-24  4:18 GETHOSTBYNAME() shesha bhushan
2003-03-24  4:55 ` GETHOSTBYNAME() Prasad
2003-03-24  6:43   ` GETHOSTBYNAME() Jan Hudec
2003-03-24  9:23 ` GETHOSTBYNAME() Martin Mares
     [not found] <F64RsqSoQHK3gSkQsfl0000279b@hotmail.com>
2003-03-24  5:51 ` GETHOSTBYNAME() Prasad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox