Ethereal-dev: Re: [ethereal-dev] Sending raw packets

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Christian Brunner <chb@xxxxxx>
Date: Wed, 6 Jan 1999 13:10:19 +0100 (CET)
Currently, I'm sending packets this way (I found this methon in SPAK -
http://freeport.xenos.net/~xenon/software/spak/):

int genpacket_send(char *packet, int packet_len, char *device) {
   int sockid;
   struct sockaddr sa;

   sa.sa_family = AF_INET;
   strcpy(sa.sa_data, device);

   sockid = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL));
   fcntl(sockid, F_SETFL, O_NDELAY);
   sendto(sockid, packet, packet_len, 0, &sa, sizeof(sa));
   close(sockid);
}

However, I think this works only under Linux. I don't know about other
systems. Feel free to send me packet_send-functions() for other systems.

Christian

On Tue, 5 Jan 1999, Guy Harris wrote:

> What mechanism are you planning on using to send the packets?