Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / libpcap / pcap.c.rej
blobc3e1e6c4ccbeaf917bcbbd612d568d77796b1fdf
1 --- pcap.c      2008-10-10 19:42:44.000000000 -0700
2 +++ pcap.c      2008-12-15 08:45:29.000000000 -0800
3 @@ -273,6 +277,20 @@
4  int
5  pcap_dispatch(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
6  {
7 +#ifdef HAVE_REMOTE
8 +       /* Checks the capture type */
9 +       if (p->rmt_clientside)
10 +       {
11 +               /* We are on an remote capture */
12 +               if (!p->rmt_capstarted)
13 +               {
14 +                       // if the capture has not started yet, please start it
15 +                       if (pcap_startcapture_remote(p) )
16 +                               return -1;
17 +               }
18 +       }
19 +#endif /* HAVE_REMOTE */
21         return p->read_op(p, cnt, callback, user);
22  }
24 @@ -382,6 +414,22 @@
25         /* Saves a pointer to the packet headers */
26         *pkt_header= &p->pcap_header;
28 +#ifdef HAVE_REMOTE
29 +       /* Checks the capture type */
30 +       if (p->rmt_clientside)
31 +       {
32 +               /* We are on an remote capture */
33 +               if (!p->rmt_capstarted)
34 +               {
35 +                       // if the capture has not started yet, please start it
36 +                       if (pcap_startcapture_remote(p) )
37 +                               return -1;
38 +               }
40 +               return pcap_read_nocb_remote(p, pkt_header, (u_char **) pkt_data);
41 +       }
42 +#endif /* HAVE_REMOTE */
44         if (p->sf.rfile != NULL) {
45                 int status;