patch-src_packet_c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. --- iptraf-3.0.1.orig/src/packet.c 2007-09-25 11:21:18.000000000 +0200
  2. +++ iptraf-3.0.1/src/packet.c 2024-02-25 18:13:41.165645150 +0100
  3. @@ -36,8 +36,6 @@ details.
  4. #include <linux/if_ether.h>
  5. #include <linux/netdevice.h>
  6. #include <linux/if_fddi.h>
  7. -#include <linux/if_tr.h>
  8. -#include <linux/isdn.h>
  9. #include <linux/sockios.h>
  10. #include <msgboxes.h>
  11. #include "deskman.h"
  12. @@ -107,21 +105,7 @@ unsigned short getlinktype(unsigned shor
  13. result = LINK_ETHERNET;
  14. else if (strncmp(ifname, "tap", 3) == 0)
  15. result = LINK_ETHERNET;
  16. - else if ((strncmp(ifname, "isdn", 4) == 0) && (isdn_fd != -1)) {
  17. - isdnent = isdn_table_lookup(isdnlist, ifname, isdn_fd);
  18. -
  19. - switch (isdnent->encap) {
  20. - case ISDN_NET_ENCAP_RAWIP:
  21. - result = LINK_ISDN_RAWIP;
  22. - break;
  23. - case ISDN_NET_ENCAP_CISCOHDLC:
  24. - result = LINK_ISDN_CISCOHDLC;
  25. - break;
  26. - default:
  27. - result = LINK_INVALID;
  28. - break;
  29. - }
  30. - } else if (accept_unsupported_interfaces)
  31. + else if (accept_unsupported_interfaces)
  32. result = LINK_ETHERNET;
  33. break;
  34. case ARPHRD_LOOPBACK:
  35. @@ -136,9 +120,6 @@ unsigned short getlinktype(unsigned shor
  36. case ARPHRD_PPP:
  37. result = LINK_PPP;
  38. break;
  39. - case ARPHRD_FDDI:
  40. - result = LINK_FDDI;
  41. - break;
  42. case ARPHRD_IEEE802:
  43. case ARPHRD_IEEE802_TR:
  44. result = LINK_TR;
  45. @@ -194,36 +175,6 @@ void adjustpacket(char *tpacket, unsigne
  46. *packet = tpacket + 4;
  47. *readlen -= 4;
  48. break;
  49. - case LINK_FDDI:
  50. - *packet = tpacket + sizeof(struct fddihdr);
  51. - *readlen -= sizeof(struct fddihdr);
  52. -
  53. - /*
  54. - * Move IP data into an aligned buffer. 96 bytes should be sufficient
  55. - * for IP and TCP headers with reasonable numbers of options and some
  56. - * data.
  57. - */
  58. -
  59. - memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
  60. - *packet = aligned_buf;
  61. - break;
  62. - case LINK_TR:
  63. - /*
  64. - * Token Ring patch supplied by Tomas Dvorak
  65. - */
  66. -
  67. - /*
  68. - * Get the start of the IP packet from the Token Ring frame.
  69. - */
  70. - dataoffset = get_tr_ip_offset(tpacket);
  71. - *packet = tpacket + dataoffset;
  72. - *readlen -= dataoffset;
  73. - /*
  74. - * Move IP datagram into an aligned buffer.
  75. - */
  76. - memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
  77. - *packet = aligned_buf;
  78. - break;
  79. case LINK_IPIP:
  80. *packet = tpacket;
  81. break;
  82. @@ -463,5 +414,4 @@ void pkt_cleanup(void)
  83. close(isdnfd);
  84. isdnfd = -1;
  85. destroyfraglist();
  86. - destroy_isdn_table(&isdntable);
  87. }