1 --- pcap-linux.c 2008-10-27 18:52:19.000000000 -0700
2 +++ pcap-linux.c 2008-12-15 10:40:38.000000000 -0800
4 pcap_create(const char *device, char *ebuf)
7 + char *device_no_prefix = (char*)device;
11 + Retrofit; we have to make older applications compatible with the remote capture
12 + So, we're calling the pcap_open_remote() from here, that is a very dirty thing.
13 + Obviously, we cannot exploit all the new features; for instance, we cannot
14 + send authentication, we cannot use a UDP data connection, and so on.
17 + char host[PCAP_BUF_SIZE + 1];
18 + char port[PCAP_BUF_SIZE + 1];
19 + char name[PCAP_BUF_SIZE + 1];
22 + if (pcap_parsesrcstr(device, &srctype, host, port, name, ebuf) )
25 + if (srctype == PCAP_SRC_IFREMOTE)
27 + handle = pcap_create_common(device, ebuf);
31 + handle->activate_op = pcap_activate_linux;
32 + handle->can_set_rfmon_op = NULL;
36 + if (srctype == PCAP_SRC_IFLOCAL)
39 + * If it starts with rpcap://, cut down the string
41 + if (strncmp(device, PCAP_SRC_IF_STRING, strlen(PCAP_SRC_IF_STRING)) == 0)
43 + device_no_prefix = (char*)device + strlen(PCAP_SRC_IF_STRING);
46 +#endif /* HAVE_REMOTE */
49 - if (strstr(device, "dag")) {
50 - return dag_create(device, ebuf);
51 + if (strstr(device_no_prefix, "dag")) {
52 + return dag_create(device_no_prefix, ebuf);
54 #endif /* HAVE_DAG_API */
56 #ifdef HAVE_SEPTEL_API
57 - if (strstr(device, "septel")) {
58 - return septel_create(device, ebuf);
59 + if (strstr(device_no_prefix, "septel")) {
60 + return septel_create(device_no_prefix, ebuf);
62 #endif /* HAVE_SEPTEL_API */
64 #ifdef PCAP_SUPPORT_BT
65 - if (strstr(device, "bluetooth")) {
66 - return bt_create(device, ebuf);
67 + if (strstr(device_no_prefix, "bluetooth")) {
68 + return bt_create(device_no_prefix, ebuf);
72 #ifdef PCAP_SUPPORT_USB
73 - if (strstr(device, "usb")) {
74 - return usb_create(device, ebuf);
75 + if (strstr(device_no_prefix, "usb")) {
76 + return usb_create(device_no_prefix, ebuf);
80 - handle = pcap_create_common(device, ebuf);
81 + handle = pcap_create_common(device_no_prefix, ebuf);