Changeset a9d9fd6
- Timestamp:
- 06/28/04 12:55:10 (17 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 139a80d
- Parents:
- c681e86
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/Makefile
rc681e86 ra9d9fd6 10 10 11 11 CURRENT=1 12 REVISION= 312 REVISION=4 13 13 AGE=0 14 14 -
lib/trace.c
rc681e86 ra9d9fd6 202 202 * - erf:/path/to/rtclient/socket 203 203 * - erf:- (stdin) 204 * - dag:/dev/dagcard ( implementd?)204 * - dag:/dev/dagcard (not implementd) 205 205 * - pcap:pcapinterface (eg: pcap:eth0) 206 206 * - pcap:/path/to/pcap/file 207 207 * - pcap:/path/to/pcap/file.gz 208 * - pcap:/path/to/pcap/socket ( implemented?)208 * - pcap:/path/to/pcap/socket (not implemented) 209 209 * - pcap:- 210 210 * - rtclient:hostname … … 338 338 buffer = malloc(len); 339 339 340 /* TODO: Make me a switch */ 341 if(libtrace->sourcetype == SOCKET || libtrace->sourcetype == RT) { 342 // read from the network 343 if ((numbytes=recv(libtrace->input.fd, buffer, len, 0)) == -1) { 344 perror("recv"); 345 return -1; 346 } 347 } else if (libtrace->sourcetype == DEVICE) { 348 if ((numbytes=read(libtrace->input.fd, buffer, len)) == -1) { 349 perror("read"); 350 return -1; 351 } 352 } else { 353 if ((numbytes=gzread(libtrace->input.file,buffer,len)) == -1) { 354 perror("gzread"); 355 return -1; 356 } 357 } 340 switch(libtrace->sourcetype) { 341 case SOCKET: 342 case RT: 343 // read from the network 344 if ((numbytes=recv(libtrace->input.fd, 345 buffer, 346 len, 347 0)) == -1) { 348 perror("recv"); 349 return -1; 350 } 351 break; 352 case DEVICE: 353 if ((numbytes=read(libtrace->input.fd, 354 buffer, 355 len)) == -1) { 356 perror("read"); 357 return -1; 358 } 359 break; 360 default: 361 if ((numbytes=gzread(libtrace->input.file, 362 buffer, 363 len)) == -1) { 364 perror("gzread"); 365 return -1; 366 } 367 } 358 368 return numbytes; 359 369
Note: See TracChangeset
for help on using the changeset viewer.