Previous 15994 Revisions Next

r13312 Sunday 20th November, 2011 at 02:39:10 UTC by R. Belmont
More SDL pcap work (nw)
[src/osd/sdl]netdev_pcap.c

src/osd/sdl/netdev_pcap.c
r13311r13312
2727   m_p = pcap_open_live(name, 65535, 1, 1, errbuf);
2828   if(!m_p)
2929   {
30      mame_print_verbose("Unable to open %s: %s\n", name, errbuf);
30      mame_printf_verbose("Unable to open %s: %s\n", name, errbuf);
3131      return;
3232   }
3333   if(pcap_set_datalink(m_p, DLT_EN10MB) == -1)
3434   {
35      mame_print_verbose("Unable to set %s to ethernet", name);
35      mame_printf_verbose("Unable to set %s to ethernet", name);
3636      pcap_close(m_p);
3737      m_p = NULL;
3838      return;
r13311r13312
4545   char filter[256];
4646   struct bpf_program fp;
4747   if(!m_p) return;
48   smame_print_verbose(filter, "ether dst %.2X:%.2X:%.2X:%.2X:%.2X:%.2X or ether multicast or ether broadcast", (unsigned char)mac[0], (unsigned char)mac[1], (unsigned char)mac[2],(unsigned char)mac[3], (unsigned char)mac[4], (unsigned char)mac[5]);
48   sprintf(filter, "ether dst %.2X:%.2X:%.2X:%.2X:%.2X:%.2X or ether multicast or ether broadcast", (unsigned char)mac[0], (unsigned char)mac[1], (unsigned char)mac[2],(unsigned char)mac[3], (unsigned char)mac[4], (unsigned char)mac[5]);
4949   pcap_compile(m_p, &fp, filter, 1, 0);
5050   pcap_setfilter(m_p, &fp);
5151}
r13311r13312
8080   char errbuf[PCAP_ERRBUF_SIZE];
8181   if(pcap_findalldevs(&devs, errbuf) == -1)
8282   {
83      mame_print_verbose("Unable to get network devices: %s\n", errbuf);
83      mame_printf_verbose("Unable to get network devices: %s\n", errbuf);
8484      return;
8585   }
8686   while(devs->next)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team