Changeset ef55d05
- Timestamp:
- 08/04/05 16:16:12 (15 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:
- 77bd94f
- Parents:
- 9e2a109
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_erf.c
r9e2a109 ref55d05 314 314 // extract conn_info from uridata 315 315 if (strlen(uridata) == 0) { 316 libtrace->format_data->conn_info.rt.hostname = 317 strdup("localhost"); 318 libtrace->format_data->conn_info.rt.port = COLLECTOR_PORT; 316 libtrace->conn_info.rt.hostname = NULL; 317 libtrace->conn_info.rt.port = COLLECTOR_PORT; 319 318 } 320 319 else { 321 320 if ((scan = strchr(uridata,':')) == NULL) { 322 libtrace-> format_data->conn_info.rt.hostname =323 strdup(uridata);324 libtrace-> format_data->conn_info.rt.port =325 COLLECTOR_PORT;321 libtrace->conn_info.rt.hostname = 322 NULL; 323 libtrace->conn_info.rt.port = 324 atoi(uridata); 326 325 } else { 327 326 libtrace->format_data->conn_info.rt.hostname = … … 647 646 fifo_out_update(libtrace->fifo, size); 648 647 fifo_ack_update(libtrace->fifo, size); 648 return numbytes; 649 649 } while(1); 650 650 } … … 706 706 } 707 707 708 static size_t erf_set_capture_length(struct libtrace_packet_t *packet, constsize_t size) {708 static size_t erf_set_capture_length(struct libtrace_packet_t *packet, size_t size) { 709 709 dag_record_t *erfptr = 0; 710 710 assert(packet); … … 737 737 printf("\terf:/path/to/file\t(uncompressed)\n"); 738 738 printf("\terf:/path/to/file.gz\t(gzip-compressed)\n"); 739 printf("\terf:-\t(stdin, either compressed or not)\n") /739 printf("\terf:-\t(stdin, either compressed or not)\n"); 740 740 printf("\terf:/path/to/socket\n"); 741 741 printf("\n"); … … 743 743 printf("\n"); 744 744 printf("Supported output URIs:\n"); 745 printf("\tnone\n"); 746 printf("\n"); 747 745 printf("\terf:path/to/file\t(uncompressed)\n"); 746 printf("\terf:/path/to/file.gz\t(gzip-compressed)\n"); 747 printf("\terf:-\t(stdout, either compressed or not)\n"); 748 printf("\n"); 749 printf("\te.g.: erf:/tmp/trace\n"); 750 printf("\n"); 751 printf("Supported output options:\n"); 752 printf("\t-z\tSpecify the gzip compression, ranging from 0 (uncompressed) to 9 - defaults to 1\n"); 753 printf("\n"); 754 755 748 756 } 749 757 … … 752 760 printf("Supported input URIs:\n"); 753 761 printf("\trtclient:hostname:port\n"); 754 printf("\trtclient: port\n");762 printf("\trtclient:hostname (connects on default port)\n"); 755 763 printf("\n"); 756 764 printf("\te.g.: rtclient:localhost\n"); … … 758 766 printf("\n"); 759 767 printf("Supported output URIs:\n"); 768 printf("\trtclient: \t(will output on default port on all available IP addresses) \n"); 769 printf("\trtclient:hostname:port\n"); 760 770 printf("\trtclient:port\n"); 761 771 printf("\n"); 762 772 printf("\te.g.: rtclient:32500\n"); 773 printf("\te.g.: rtclient:\n"); 763 774 printf("\n"); 764 775 -
lib/rtserver.c
r9456f1e ref55d05 28 28 FD_ZERO(&rtserver->rt_fds); 29 29 30 if ((he=gethostbyname(hostname)) == NULL) { 31 perror("gethostbyname"); 32 return 0; 33 } 30 if (hostname) { 31 if ((he=gethostbyname(hostname)) == NULL) { 32 perror("gethostbyname"); 33 return 0; 34 } 35 } 36 34 37 if ((rtserver->connect_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { 35 38 perror("socket"); … … 44 47 bzero((char *) rtserver->remote, sizeof(rtserver->remote)); 45 48 rtserver->remote->sin_family = AF_INET; 46 rtserver->remote->sin_addr.s_addr = INADDR_ANY; 49 if (hostname) 50 rtserver->remote->sin_addr = *((struct in_addr *)he->h_addr); 51 else 52 rtserver->remote->sin_addr.s_addr = INADDR_ANY; 47 53 rtserver->remote->sin_port = htons(port); 48 54 … … 56 62 return 0; 57 63 } 58 64 59 65 rtserver->max_rtfds = rtserver->connect_fd; 60 66 -
lib/trace.c
r9e2a109 ref55d05 367 367 } 368 368 369 /** Parses an output options string and calls the appropriate function to deal with output options. 370 * 371 * @param libtrace the output trace object to apply the options to 372 * @param options the options string 373 * @returns -1 if option configuration failed, 0 otherwise 374 * 375 * @author Shane Alcock 376 */ 369 377 int trace_output_config(struct libtrace_out_t *libtrace, char *options) { 370 378 char *opt_string = 0;
Note: See TracChangeset
for help on using the changeset viewer.