seanh@r6.cs.man.ac.uk (Sean Holdsworth) (04/29/91)
I'm currently trying to use the NIT interface to the ethernet. Whilst I've got the receiving side working without too much pain, I'm beginning to have doubts about whether what I'm trying to do on the send side is possible. What I want to be able to do is to build and send ethernet packets. I'd hoped to be able to assign my own ethernet packet type in the same way as IP, ARP, RARP et al. do. I can see that this could cause problems on the receive side but I can't even get the packet onto the net. My approach is to build a message out of a control part comprising the destination address; a sockaddr structure with sa_family set to AF_UNSPEC and with the sa_data being the ethernet header. I then build a data part comprising the same ethernet header concatenated with the actual data. The message is then sent down the nit stream using putmsg. Am I doing something obviously wrong? Are there any known bugs which might be biting me? I'm running SUNOS 4.1 on a Sparc station using the le0 interface. One anomaly I have come across is the manual page description of the write side behaviour of the nit_if module; if I read it correctly it implies that if the data part of the message does not start with an ethernet header then an error will be signalled back up the stream and this does not seem to be happening... Any help will be much appreciated especially if someone could send me some working source code of a toy example. Sean Holdsworth. UUCP: ...!uunet!mcsun!ukc!man.cs!seanh Fax: +44-61-275-6236 Inet: seanh%cs.man.ac.uk@nsfnet-relay.ac.uk Int: 6294