tcpprep.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /* $Id: tcpprep.c 1899 2007-08-26 19:03:50Z aturner $ */
  2. /*
  3. * Copyright (c) 2001-2007 Aaron Turner.
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the names of the copyright owners nor the names of its
  16. * contributors may be used to endorse or promote products derived from
  17. * this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  20. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  21. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  23. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  25. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  27. * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  28. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  29. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * Purpose:
  33. * 1) Remove the performance bottleneck in tcpreplay for choosing an NIC
  34. * 2) Seperate code to make it more manageable
  35. * 3) Add addtional features which require multiple passes of a pcap
  36. *
  37. * Support:
  38. * Right now we support matching source IP based upon on of the following:
  39. * - Regular expression
  40. * - IP address is contained in one of a list of CIDR blocks
  41. * - Auto learning of CIDR block for servers (clients all other)
  42. */
  43. #include "config.h"
  44. #include "defines.h"
  45. #include "common.h"
  46. #include <stdio.h>
  47. #include <stdlib.h>
  48. #include <string.h>
  49. #include <regex.h>
  50. #include <string.h>
  51. #include <unistd.h>
  52. #include <errno.h>
  53. #include "tcpprep.h"
  54. #include "tcpedit/tcpedit.h"
  55. #include "tcpprep_opts.h"
  56. #include "lib/tree.h"
  57. #include "tree.h"
  58. #include "lib/sll.h"
  59. #include "lib/strlcpy.h"
  60. /*
  61. * global variables
  62. */
  63. #ifdef DEBUG
  64. int debug = 0;
  65. #endif
  66. #ifdef ENABLE_VERBOSE
  67. tcpdump_t tcpdump;
  68. #endif
  69. tcpprep_opt_t options;
  70. int info = 0;
  71. char *ourregex = NULL;
  72. char *cidr = NULL;
  73. tcpr_data_tree_t treeroot;
  74. static void init(void);
  75. static void post_args(int, char *[]);
  76. static void print_comment(const char *);
  77. static void print_info(const char *);
  78. static void print_stats(const char *);
  79. static int check_ip_regex(const unsigned long ip);
  80. static COUNTER process_raw_packets(pcap_t * pcap);
  81. static int check_dst_port(ipv4_hdr_t *ip_hdr, int len);
  82. /*
  83. * main()
  84. */
  85. int
  86. main(int argc, char *argv[])
  87. {
  88. int out_file;
  89. COUNTER totpackets = 0;
  90. char errbuf[PCAP_ERRBUF_SIZE];
  91. int optct = 0;
  92. init(); /* init our globals */
  93. optct = optionProcess(&tcpprepOptions, argc, argv);
  94. post_args(argc, argv);
  95. argc -= optct;
  96. argv += optct;
  97. /* open the cache file */
  98. if ((out_file = open(OPT_ARG(CACHEFILE), O_WRONLY | O_CREAT | O_TRUNC,
  99. S_IREAD | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH)) == -1)
  100. errx(1, "Unable to open cache file %s for writing: %s",
  101. OPT_ARG(CACHEFILE), strerror(errno));
  102. readpcap:
  103. /* open the pcap file */
  104. if ((options.pcap = pcap_open_offline(OPT_ARG(PCAP), errbuf)) == NULL)
  105. errx(1, "Error opening file: %s", errbuf);
  106. /* make sure we support the DLT type */
  107. switch(pcap_datalink(options.pcap)) {
  108. case DLT_EN10MB:
  109. case DLT_LINUX_SLL:
  110. case DLT_RAW:
  111. case DLT_C_HDLC:
  112. break; /* do nothing because all is good */
  113. default:
  114. errx(1, "Unsupported pcap DLT type: 0x%x", pcap_datalink(options.pcap));
  115. }
  116. /* Can only split based on MAC address for ethernet */
  117. if ((pcap_datalink(options.pcap) != DLT_EN10MB) &&
  118. (options.mode == MAC_MODE)) {
  119. err(1, "MAC mode splitting is only supported by DLT_EN10MB packet captures.");
  120. }
  121. #ifdef ENABLE_VERBOSE
  122. if (HAVE_OPT(VERBOSE)) {
  123. tcpdump_open(&tcpdump, options.pcap);
  124. }
  125. #endif
  126. /* do we apply a bpf filter? */
  127. if (options.bpf.filter != NULL) {
  128. if (pcap_compile(options.pcap, &options.bpf.program, options.bpf.filter,
  129. options.bpf.optimize, 0) != 0) {
  130. errx(1, "Error compiling BPF filter: %s", pcap_geterr(options.pcap));
  131. }
  132. pcap_setfilter(options.pcap, &options.bpf.program);
  133. }
  134. if ((totpackets = process_raw_packets(options.pcap)) == 0) {
  135. pcap_close(options.pcap);
  136. err(1, "No packets were processed. Filter too limiting?");
  137. }
  138. pcap_close(options.pcap);
  139. #ifdef ENABLE_VERBOSE
  140. tcpdump_close(&tcpdump);
  141. #endif
  142. /* we need to process the pcap file twice in HASH/AUTO mode */
  143. if (options.mode == AUTO_MODE) {
  144. options.mode = options.automode;
  145. if (options.mode == ROUTER_MODE) { /* do we need to convert TREE->CIDR? */
  146. if (info)
  147. fprintf(stderr, "Building network list from pre-cache...\n");
  148. if (!process_tree()) {
  149. err(1, "Error: unable to build a valid list of servers. Aborting.");
  150. }
  151. }
  152. else {
  153. /*
  154. * in bridge mode we need to calculate client/sever
  155. * manually since this is done automatically in
  156. * process_tree()
  157. */
  158. tree_calculate(&treeroot);
  159. }
  160. if (info)
  161. fprintf(stderr, "Buliding cache file...\n");
  162. /*
  163. * re-process files, but this time generate
  164. * cache
  165. */
  166. goto readpcap;
  167. }
  168. #ifdef DEBUG
  169. if (debug && (options.cidrdata != NULL))
  170. print_cidr(options.cidrdata);
  171. #endif
  172. /* write cache data */
  173. totpackets = write_cache(options.cachedata, out_file, totpackets,
  174. options.comment);
  175. if (info)
  176. notice("Done.\nCached " COUNTER_SPEC " packets.\n", totpackets);
  177. /* close cache file */
  178. close(out_file);
  179. return 0;
  180. }
  181. /**
  182. * checks the dst port to see if this is destined for a server port.
  183. * returns 1 for true, 0 for false
  184. */
  185. static int
  186. check_dst_port(ipv4_hdr_t *ip_hdr, int len)
  187. {
  188. tcp_hdr_t *tcp_hdr = NULL;
  189. udp_hdr_t *udp_hdr = NULL;
  190. assert(ip_hdr);
  191. if (len < ((ip_hdr->ip_hl * 4) + 4))
  192. return 0; /* not enough data in the packet to know */
  193. dbg(3, "Checking the destination port...");
  194. if (ip_hdr->ip_p == IPPROTO_TCP) {
  195. tcp_hdr = (tcp_hdr_t *)get_layer4(ip_hdr);
  196. /* is a service? */
  197. if (options.services.tcp[ntohs(tcp_hdr->th_dport)]) {
  198. dbgx(1, "TCP packet is destined for a server port: %d", ntohs(tcp_hdr->th_dport));
  199. return 1;
  200. }
  201. /* nope */
  202. dbgx(1, "TCP packet is NOT destined for a server port: %d", ntohs(tcp_hdr->th_dport));
  203. return 0;
  204. } else if (ip_hdr->ip_p == IPPROTO_UDP) {
  205. udp_hdr = (udp_hdr_t *)get_layer4(ip_hdr);
  206. /* is a service? */
  207. if (options.services.udp[ntohs(udp_hdr->uh_dport)]) {
  208. dbgx(1, "UDP packet is destined for a server port: %d", ntohs(udp_hdr->uh_dport));
  209. return 1;
  210. }
  211. /* nope */
  212. dbgx(1, "UDP packet is NOT destined for a server port: %d", ntohs(udp_hdr->uh_dport));
  213. return 0;
  214. }
  215. /* not a TCP or UDP packet... return as non_ip */
  216. dbg(1, "Packet isn't a UDP or TCP packet... no port to process.");
  217. return options.nonip;
  218. }
  219. /**
  220. * checks to see if an ip address matches a regex. Returns 1 for true
  221. * 0 for false
  222. */
  223. static int
  224. check_ip_regex(const unsigned long ip)
  225. {
  226. int eflags = 0;
  227. u_char src_ip[16];
  228. size_t nmatch = 0;
  229. regmatch_t *pmatch = NULL;
  230. memset(src_ip, '\0', 16);
  231. strlcpy((char *)src_ip, (char *)get_addr2name4(ip, RESOLVE),
  232. sizeof(src_ip));
  233. if (regexec(&options.preg, (char *)src_ip, nmatch, pmatch, eflags) == 0) {
  234. return (1);
  235. }
  236. else {
  237. return (0);
  238. }
  239. }
  240. /**
  241. * uses libpcap library to parse the packets and build
  242. * the cache file.
  243. */
  244. static COUNTER
  245. process_raw_packets(pcap_t * pcap)
  246. {
  247. ipv4_hdr_t *ip_hdr = NULL;
  248. eth_hdr_t *eth_hdr = NULL;
  249. struct pcap_pkthdr pkthdr;
  250. const u_char *pktdata = NULL;
  251. COUNTER packetnum = 0;
  252. int l2len, cache_result = 0;
  253. u_char ipbuff[MAXPACKET], *buffptr;
  254. #ifdef ENABLE_VERBOSE
  255. struct pollfd poller[1];
  256. poller[0].fd = tcpdump.outfd;
  257. poller[0].events = POLLIN;
  258. poller[0].revents = 0;
  259. #endif
  260. assert(pcap);
  261. while ((pktdata = pcap_next(pcap, &pkthdr)) != NULL) {
  262. packetnum++;
  263. dbgx(1, "Packet " COUNTER_SPEC, packetnum);
  264. /* look for include or exclude LIST match */
  265. if (options.xX.list != NULL) {
  266. if (options.xX.mode < xXExclude) {
  267. if (!check_list(options.xX.list, packetnum)) {
  268. add_cache(&(options.cachedata), DONT_SEND, 0);
  269. continue;
  270. }
  271. }
  272. else if (check_list(options.xX.list, packetnum)) {
  273. add_cache(&(options.cachedata), DONT_SEND, 0);
  274. continue;
  275. }
  276. }
  277. eth_hdr = (eth_hdr_t *)pktdata;
  278. /* get the IP header (if any) */
  279. buffptr = ipbuff;
  280. ip_hdr = (ipv4_hdr_t *)get_ipv4(pktdata, pkthdr.caplen,
  281. pcap_datalink(pcap), &buffptr);
  282. if (ip_hdr == NULL) {
  283. dbg(2, "Packet isn't IP");
  284. /* we don't want to cache these packets twice */
  285. if (options.mode != AUTO_MODE) {
  286. dbg(3, "Adding to cache using options for Non-IP packets");
  287. add_cache(&options.cachedata, SEND, options.nonip);
  288. }
  289. continue;
  290. }
  291. l2len = get_l2len(pktdata, pkthdr.caplen, pcap_datalink(pcap));
  292. /* look for include or exclude CIDR match */
  293. if (options.xX.cidr != NULL) {
  294. if (!process_xX_by_cidr(options.xX.mode, options.xX.cidr, ip_hdr)) {
  295. add_cache(&options.cachedata, DONT_SEND, 0);
  296. continue;
  297. }
  298. }
  299. switch (options.mode) {
  300. case REGEX_MODE:
  301. dbg(2, "processing regex mode...");
  302. cache_result = add_cache(&options.cachedata, SEND,
  303. check_ip_regex(ip_hdr->ip_src.s_addr));
  304. break;
  305. case CIDR_MODE:
  306. dbg(2, "processing cidr mode...");
  307. cache_result = add_cache(&options.cachedata, SEND,
  308. check_ip_cidr(options.cidrdata, ip_hdr->ip_src.s_addr) ? TCPR_DIR_C2S : TCPR_DIR_S2C );
  309. break;
  310. case MAC_MODE:
  311. dbg(2, "processing mac mode...");
  312. cache_result = add_cache(&options.cachedata, SEND,
  313. macinstring(options.maclist, (u_char *)eth_hdr->ether_shost));
  314. break;
  315. case AUTO_MODE:
  316. dbg(2, "processing first pass of auto mode...");
  317. /* first run through in auto mode: create tree */
  318. if (options.automode != FIRST_MODE) {
  319. add_tree(ip_hdr->ip_src.s_addr, pktdata);
  320. } else {
  321. add_tree_first(pktdata);
  322. }
  323. break;
  324. case ROUTER_MODE:
  325. /*
  326. * second run through in auto mode: create route
  327. * based cache
  328. */
  329. dbg(2, "processing second pass of auto: router mode...");
  330. cache_result = add_cache(&options.cachedata, SEND,
  331. check_ip_tree(options.nonip, ip_hdr->ip_src.s_addr));
  332. break;
  333. case BRIDGE_MODE:
  334. /*
  335. * second run through in auto mode: create bridge
  336. * based cache
  337. */
  338. dbg(2, "processing second pass of auto: bridge mode...");
  339. cache_result = add_cache(&options.cachedata, SEND,
  340. check_ip_tree(DIR_UNKNOWN, ip_hdr->ip_src.s_addr));
  341. break;
  342. case SERVER_MODE:
  343. /*
  344. * second run through in auto mode: create bridge
  345. * where unknowns are servers
  346. */
  347. dbg(2, "processing second pass of auto: server mode...");
  348. cache_result = add_cache(&options.cachedata, SEND,
  349. check_ip_tree(DIR_SERVER, ip_hdr->ip_src.s_addr));
  350. break;
  351. case CLIENT_MODE:
  352. /*
  353. * second run through in auto mode: create bridge
  354. * where unknowns are clients
  355. */
  356. dbg(2, "processing second pass of auto: client mode...");
  357. cache_result = add_cache(&options.cachedata, SEND,
  358. check_ip_tree(DIR_CLIENT, ip_hdr->ip_src.s_addr));
  359. break;
  360. case PORT_MODE:
  361. /*
  362. * process ports based on their destination port
  363. */
  364. dbg(2, "processing port mode...");
  365. cache_result = add_cache(&options.cachedata, SEND,
  366. check_dst_port(ip_hdr, (pkthdr.caplen - l2len)));
  367. break;
  368. case FIRST_MODE:
  369. /*
  370. * First packet mode, looks at each host and picks clients
  371. * by the ones which send the first packet in a session
  372. */
  373. dbg(2, "processing second pass of auto: first packet mode...");
  374. cache_result = add_cache(&options.cachedata, SEND,
  375. check_ip_tree(DIR_UNKNOWN, ip_hdr->ip_src.s_addr));
  376. break;
  377. }
  378. #ifdef ENABLE_VERBOSE
  379. if (options.verbose)
  380. tcpdump_print(&tcpdump, &pkthdr, pktdata);
  381. #endif
  382. }
  383. return packetnum;
  384. }
  385. /**
  386. * init our options
  387. */
  388. void
  389. init(void)
  390. {
  391. int i;
  392. memset(&options, '\0', sizeof(options));
  393. options.bpf.optimize = BPF_OPTIMIZE;
  394. for (i = DEFAULT_LOW_SERVER_PORT; i <= DEFAULT_HIGH_SERVER_PORT; i++) {
  395. options.services.tcp[i] = 1;
  396. options.services.udp[i] = 1;
  397. }
  398. }
  399. /**
  400. * post process args
  401. */
  402. static void
  403. post_args(int argc, char *argv[])
  404. {
  405. char myargs[MYARGS_LEN];
  406. int i, bufsize;
  407. char *tempstr;
  408. memset(myargs, 0, MYARGS_LEN);
  409. /* print_comment and print_info don't return */
  410. if (HAVE_OPT(PRINT_COMMENT))
  411. print_comment(OPT_ARG(PRINT_COMMENT));
  412. if (HAVE_OPT(PRINT_INFO))
  413. print_info(OPT_ARG(PRINT_INFO));
  414. if (HAVE_OPT(PRINT_STATS))
  415. print_stats(OPT_ARG(PRINT_STATS));
  416. if (! HAVE_OPT(CACHEFILE) && ! HAVE_OPT(PCAP))
  417. err(1, "Must specify an output cachefile (-o) and input pcap (-i)");
  418. if (! options.mode)
  419. err(1, "Must specify a processing mode: -a, -c, -r, -p");
  420. #ifdef DEBUG
  421. if (HAVE_OPT(DBUG))
  422. debug = OPT_VALUE_DBUG;
  423. #endif
  424. #ifdef ENABLE_VERBOSE
  425. if (HAVE_OPT(VERBOSE)) {
  426. options.verbose = 1;
  427. }
  428. if (HAVE_OPT(DECODE))
  429. tcpdump.args = safe_strdup(OPT_ARG(DECODE));
  430. /*
  431. * put the open after decode options so they are passed to tcpdump
  432. */
  433. #endif
  434. /*
  435. * if we are to include the cli args, then prep it for the
  436. * cache file header
  437. */
  438. if (! options.nocomment) {
  439. /* copy all of our args to myargs */
  440. for (i = 1; i < argc; i ++) {
  441. /* skip the -C <comment> */
  442. if (strcmp(argv[i], "-C") == 0) {
  443. i += 2;
  444. continue;
  445. }
  446. strlcat(myargs, argv[i], MYARGS_LEN);
  447. strlcat(myargs, " ", MYARGS_LEN);
  448. }
  449. /* remove trailing space */
  450. myargs[strlen(myargs) - 1] = 0;
  451. dbgx(1, "Comment args length: %d", strlen(myargs));
  452. }
  453. /* setup or options.comment buffer so that that we get args\ncomment */
  454. if (options.comment != NULL) {
  455. strlcat(myargs, "\n", MYARGS_LEN);
  456. bufsize = strlen(options.comment) + strlen(myargs) + 1;
  457. options.comment = (char *)safe_realloc(options.comment,
  458. bufsize);
  459. tempstr = strdup(options.comment);
  460. strlcpy(options.comment, myargs, bufsize);
  461. strlcat(options.comment, tempstr, bufsize);
  462. } else {
  463. bufsize = strlen(myargs) + 1;
  464. options.comment = (char *)safe_malloc(bufsize);
  465. strlcpy(options.comment, myargs, bufsize);
  466. }
  467. dbgx(1, "Final comment length: %d", strlen(options.comment));
  468. /* copy over our min/max mask */
  469. options.min_mask = OPT_VALUE_MINMASK;
  470. options.max_mask = OPT_VALUE_MAXMASK;
  471. if (! options.min_mask > options.max_mask)
  472. errx(1, "Min network mask len (%d) must be less then max network mask len (%d)",
  473. options.min_mask, options.max_mask);
  474. options.ratio = atof(OPT_ARG(RATIO));
  475. if (options.ratio < 0)
  476. err(1, "Ratio must be a non-negative number.");
  477. }
  478. /**
  479. * print the tcpprep cache file comment
  480. */
  481. static void
  482. print_comment(const char *file)
  483. {
  484. char *cachedata = NULL;
  485. char *comment = NULL;
  486. COUNTER count = 0;
  487. count = read_cache(&cachedata, file, &comment);
  488. printf("tcpprep args: %s\n", comment);
  489. printf("Cache contains data for " COUNTER_SPEC " packets\n", count);
  490. exit(0);
  491. }
  492. /**
  493. * prints out the cache file details
  494. */
  495. static void
  496. print_info(const char *file)
  497. {
  498. char *cachedata = NULL;
  499. char *comment = NULL;
  500. COUNTER count = 0, i;
  501. count = read_cache(&cachedata, file, &comment);
  502. for (i = 1; i <= count; i ++) {
  503. switch (check_cache(cachedata, i)) {
  504. case TCPR_DIR_C2S:
  505. printf("Packet " COUNTER_SPEC " -> Primary\n", i);
  506. break;
  507. case TCPR_DIR_S2C:
  508. printf("Packet " COUNTER_SPEC " -> Secondary\n", i);
  509. break;
  510. case TCPR_DIR_NOSEND:
  511. printf("Packet " COUNTER_SPEC " -> Don't Send\n", i);
  512. break;
  513. default:
  514. err(1, "Invalid cachedata value!");
  515. break;
  516. }
  517. }
  518. exit(0);
  519. }
  520. /**
  521. * Print the per-packet statistics
  522. */
  523. static void
  524. print_stats(const char *file)
  525. {
  526. char *cachedata = NULL;
  527. char *comment = NULL;
  528. COUNTER count = 0;
  529. COUNTER pri = 0, sec = 0, nosend = 0;
  530. count = read_cache(&cachedata, file, &comment);
  531. for (COUNTER i = 1; i <= count; i ++) {
  532. int cacheval = check_cache(cachedata, i);
  533. switch (cacheval) {
  534. case TCPR_DIR_C2S:
  535. pri ++;
  536. break;
  537. case TCPR_DIR_S2C:
  538. sec ++;
  539. break;
  540. case TCPR_DIR_NOSEND:
  541. nosend ++;
  542. break;
  543. default:
  544. errx(1, "Unknown cache value: %d", cacheval);
  545. }
  546. }
  547. printf("Primary packets:\t" COUNTER_SPEC "\n", pri);
  548. printf("Secondary packets:\t" COUNTER_SPEC "\n", sec);
  549. printf("Skipped packets:\t" COUNTER_SPEC "\n", nosend);
  550. printf("------------------------------\n");
  551. printf("Total packets:\t\t" COUNTER_SPEC "\n", count);
  552. exit(0);
  553. }
  554. /*
  555. Local Variables:
  556. mode:c
  557. indent-tabs-mode:nil
  558. c-basic-offset:4
  559. End:
  560. */