RE: [uCsimm] ethernet packets

From: Reynolds, Alfred (Alfred.Reynolds@dsto.defence.gov.au)
Date: Sun Jul 16 2000 - 18:40:19 EDT


So you want the arbitrary host to always be able to "telnet" the ucsimm.
Sounds like it may work, to open a raw socket I use :
/*
 *
 * eth_open - open a sock_packet (raw) ethernet connection to the interface
given
 * with the protocol number protocol (so we can use custom ones).
 * return the fd of the opened socket.
 */
int eth_open(char *interface,int protocol)
{
 int fd;
  
 /* open the datalink level socket using my own protocol number */
#ifdef EMBED
 if ((fd = socket(PF_INET,SOCK_PACKET,htons(protocol))) < 0 ) {
   perror("ETH_INTERFACE, socket_create error");
   exit(1);
 }
#else
if ((fd = socket(PF_INET,SOCK_PACKET,htons(protocol))) < 0 ) {
   perror("ETH_INTERFACE, socket_create error");
   exit(1);
 }

#endif
 
 return fd;
}

But why not just setup a static route in the hosts so you can just give the
ucsimm a magic ip?
I don't think dhcp will work because that would require each host you plug
into to be running the server (seeing as you are using a crossover cable to
plug into them :).

Alfred
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:37 EST