tap.cc (56:5b096933002b) tap.cc (105:5440d7a4f376)
1/*
2 * Copyright (c) 2003 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 193 unchanged lines hidden (view full) ---

202 char *device = NULL;
203 char *filter = "";
204 char c;
205 int daemon = false;
206 string host;
207
208 program = basename(argv[0]);
209
1/*
2 * Copyright (c) 2003 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 193 unchanged lines hidden (view full) ---

202 char *device = NULL;
203 char *filter = "";
204 char c;
205 int daemon = false;
206 string host;
207
208 program = basename(argv[0]);
209
210 while((c = getopt(argc, argv, "b:df:lp:v")) != -1) {
210 while ((c = getopt(argc, argv, "b:df:lp:v")) != -1) {
211 switch (c) {
212 case 'b':
213 bufsize = atoi(optarg);
214 break;
215 case 'd':
216 daemon = true;
217 break;
218 case 'f':

--- 181 unchanged lines hidden (view full) ---

400 client_pfd->revents = 0;
401 }
402
403 }
404
405 delete [] buffer;
406 pcap_close(pcap);
407 eth_close(ethernet);
211 switch (c) {
212 case 'b':
213 bufsize = atoi(optarg);
214 break;
215 case 'd':
216 daemon = true;
217 break;
218 case 'f':

--- 181 unchanged lines hidden (view full) ---

400 client_pfd->revents = 0;
401 }
402
403 }
404
405 delete [] buffer;
406 pcap_close(pcap);
407 eth_close(ethernet);
408 if(listen_pfd)
408 if (listen_pfd)
409 close(listen_pfd->fd);
410
411 if (client_pfd)
412 close(client_pfd->fd);
413
414 return 0;
415}
409 close(listen_pfd->fd);
410
411 if (client_pfd)
412 close(client_pfd->fd);
413
414 return 0;
415}