[Simh] Help getting network support to build on OS X 10.3.5

Tim Newsham newsham at lava.net
Fri Oct 15 22:16:46 EDT 2004


> I can't get SimH to compile with network support. I'm a bit uncertain
> what version of pcap should be used, for one thing. There seem to be a
> lot of declarations missing from /usr/include/pcap.h. I've also tried
> the version 0.8.1-1 from fink. With that one the only error I get is
> that pcap_sendpacket is undefined.  It's defined in pcap.h but the
> definition is conditionalized on WIN32 being defined.

The pcap library is a packet capture library.  Unfortunately
it doesn't have a function for sending packets (it should).
Some platforms have gone and added their own using various
different names.

I'm not familiar with os x's packet capture interface, but
if it is using BPF like BSD does, you can simply change it
to open the device O_RDWR (rather than O_RDONLY) and then
write your pcap_sendpacket function something along the lines
of:

   int
   pcap_sendpacket(pcap_t *p, const u_char *buf, u_int len) {
       return write(p->fd, buf, len);
   }

You may want to check that it doesn't yet have this functionality
under a different function name first.  pcap_inject and pcap_write
and pcap_send are good candidate names.

> Galen

Tim N.



More information about the Simh mailing list