├── .gitignore ├── AUTHORS ├── COPYING ├── ChangeLog ├── Makefile.am ├── NEWS ├── README ├── README.md ├── aclocal.m4 ├── bootstrap ├── compile ├── configure.ac ├── libpcap ├── .gitignore ├── Makefile ├── Makefile.am ├── Makefile.in ├── libpcap-1.1.1.tar.gz └── resolver-patch ├── src ├── .gitignore ├── Makefile.am ├── capture.c ├── capture.h ├── functions.c ├── functions.h ├── local-addresses.c ├── local-addresses.h ├── output.c ├── output.h ├── process-packet.c ├── process-packet.h ├── stats-hash.c ├── stats-hash.h ├── stats.c ├── stats.h ├── tcprstat.c ├── tcprstat.h └── tcprstat_tc └── 说明.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | *.su 34 | 35 | .deps 36 | Makefile 37 | Makefile.in 38 | aclocal.m4 39 | autom4te.cache 40 | autoscan.log 41 | config.log 42 | config.status 43 | configure 44 | configure.scan 45 | libtool 46 | stamp-h1 47 | config.h 48 | config.h* 49 | core.* 50 | compile 51 | install-sh 52 | missing 53 | depcomp 54 | INSTALL 55 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | 3058078489@qq.com 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/ChangeLog -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # tcprstat -- Extract stats about TCP response times 3 | # Copyright (C) 2010 Ignacio Nin 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | if BUILD_PCAP 22 | SUBDIRS = libpcap src 23 | else 24 | SUBDIRS = src 25 | endif 26 | 27 | CLEANFILES = tcprstat-*.tar.gz 28 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Version 0.3.1 2 | * The project was renamed to tcprstat 3 | 4 | Version 0.3.0b 5 | * %x shows the sum of response time squares 6 | 7 | Version 0.3.0 8 | * Offline captures from pcap savefiles 9 | * Ability to specify which are the local addresses. 10 | * Switched to default 95 percentile insted of 90 percentile. 11 | * Prevented incorrect results by looking only for data TCP. 12 | 13 | Version 0.2.6 14 | * Implementation now uses a hash table for the stat sessions, 15 | using much less CPU 16 | 17 | Version 0.2.5 18 | * Bugfix: -p works 19 | * Bugfix: Bailed out after 2000 data gathered 20 | 21 | Version 0.2.4 22 | * More polished messages 23 | * More data in default output 24 | 25 | Version 0.2.3 26 | * Percentiles 27 | * Sum, min, max, median, std dev 28 | 29 | Version 0.2.2 30 | * --iterations allows you to spec the number of times you want it 31 | to run. 32 | * Ability to show timestamps and iteration counts 33 | * Header 34 | 35 | * We now provide a static binary 36 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ~ tcprstat ~ 2 | 3 | tcprstat is a pcap-based tool that extracts information about TCP response 4 | times. 5 | 6 | It works by sniffing for TCP "requests" (inbound packets) and measures the time 7 | that it takes for sending a "response" (next outbound packet). While this 8 | approach might seem too simple, it works for simple protocols that are based in 9 | such request/response system, like HTTP and the MySQL protocol. In the future, 10 | we may write more complex protocol decoding. 11 | 12 | tcprstat sniffs for a while, and then shows some stats about the sniffed 13 | packets, similar to the way top(1) works. 14 | 15 | tcprstat uses libpcap to capture TCP. Due to many distros not shipping 16 | libpcap >= 1.0.0, tcprstat ships libpcap 1.1.1 and uses it if it can't find a 17 | suitable version 18 | 19 | The build process delivers a static version, tcprstat-static, with no external 20 | linking (some castration is needed at libpcap) so it can be copied directly to 21 | a server with no need for compilation tools. 22 | 23 | tcprstat is released under the GPL, version 2 or 3. 24 | 25 | ################################################################################ 26 | # # 27 | # tcprstat -- Extract stats about TCP response times # 28 | # Copyright (C) 2010 Ignacio Nin # 29 | # # 30 | # This program is free software; you can redistribute it and/or modify # 31 | # it under the terms of the GNU General Public License as published by # 32 | # the Free Software Foundation; either version 2 of the License, or # 33 | # (at your option) any later version. # 34 | # # 35 | # This program is distributed in the hope that it will be useful, # 36 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 37 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 38 | # GNU General Public License for more details. # 39 | # # 40 | # You should have received a copy of the GNU General Public License # 41 | # along with this program; if not, write to the Free Software # 42 | # Foundation, Inc., # 43 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # 44 | # # 45 | ################################################################################ 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/README.md -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_AUTOCONF_VERSION], 15 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 17 | [m4_warning([this file was generated for autoconf 2.68. 18 | You have another version of autoconf. It may work, but is not guaranteed to. 19 | If you have problems, you may need to regenerate the build system entirely. 20 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) 21 | 22 | # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 23 | # 24 | # This file is free software; the Free Software Foundation 25 | # gives unlimited permission to copy and/or distribute it, 26 | # with or without modifications, as long as this notice is preserved. 27 | 28 | # AM_AUTOMAKE_VERSION(VERSION) 29 | # ---------------------------- 30 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 31 | # generated from the m4 files accompanying Automake X.Y. 32 | # (This private macro should not be called outside this file.) 33 | AC_DEFUN([AM_AUTOMAKE_VERSION], 34 | [am__api_version='1.11' 35 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36 | dnl require some minimum version. Point them to the right macro. 37 | m4_if([$1], [1.11.1], [], 38 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39 | ]) 40 | 41 | # _AM_AUTOCONF_VERSION(VERSION) 42 | # ----------------------------- 43 | # aclocal traces this macro to find the Autoconf version. 44 | # This is a private macro too. Using m4_define simplifies 45 | # the logic in aclocal, which can simply ignore this definition. 46 | m4_define([_AM_AUTOCONF_VERSION], []) 47 | 48 | # AM_SET_CURRENT_AUTOMAKE_VERSION 49 | # ------------------------------- 50 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53 | [AM_AUTOMAKE_VERSION([1.11.1])dnl 54 | m4_ifndef([AC_AUTOCONF_VERSION], 55 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57 | 58 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 59 | 60 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61 | # 62 | # This file is free software; the Free Software Foundation 63 | # gives unlimited permission to copy and/or distribute it, 64 | # with or without modifications, as long as this notice is preserved. 65 | 66 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69 | # 70 | # Of course, Automake must honor this variable whenever it calls a 71 | # tool from the auxiliary directory. The problem is that $srcdir (and 72 | # therefore $ac_aux_dir as well) can be either absolute or relative, 73 | # depending on how configure is run. This is pretty annoying, since 74 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 75 | # source directory, any form will work fine, but in subdirectories a 76 | # relative path needs to be adjusted first. 77 | # 78 | # $ac_aux_dir/missing 79 | # fails when called from a subdirectory if $ac_aux_dir is relative 80 | # $top_srcdir/$ac_aux_dir/missing 81 | # fails if $ac_aux_dir is absolute, 82 | # fails when called from a subdirectory in a VPATH build with 83 | # a relative $ac_aux_dir 84 | # 85 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86 | # are both prefixed by $srcdir. In an in-source build this is usually 87 | # harmless because $srcdir is `.', but things will broke when you 88 | # start a VPATH build or use an absolute $srcdir. 89 | # 90 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93 | # and then we would define $MISSING as 94 | # MISSING="\${SHELL} $am_aux_dir/missing" 95 | # This will work as long as MISSING is not called from configure, because 96 | # unfortunately $(top_srcdir) has no meaning in configure. 97 | # However there are other variables, like CC, which are often used in 98 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 99 | # 100 | # Another solution, used here, is to always expand $ac_aux_dir to an 101 | # absolute PATH. The drawback is that using absolute paths prevent a 102 | # configured tree to be moved without reconfiguration. 103 | 104 | AC_DEFUN([AM_AUX_DIR_EXPAND], 105 | [dnl Rely on autoconf to set up CDPATH properly. 106 | AC_PREREQ([2.50])dnl 107 | # expand $ac_aux_dir to an absolute path 108 | am_aux_dir=`cd $ac_aux_dir && pwd` 109 | ]) 110 | 111 | # AM_CONDITIONAL -*- Autoconf -*- 112 | 113 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114 | # Free Software Foundation, Inc. 115 | # 116 | # This file is free software; the Free Software Foundation 117 | # gives unlimited permission to copy and/or distribute it, 118 | # with or without modifications, as long as this notice is preserved. 119 | 120 | # serial 9 121 | 122 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 123 | # ------------------------------------- 124 | # Define a conditional. 125 | AC_DEFUN([AM_CONDITIONAL], 126 | [AC_PREREQ(2.52)dnl 127 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 128 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129 | AC_SUBST([$1_TRUE])dnl 130 | AC_SUBST([$1_FALSE])dnl 131 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl 132 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl 133 | m4_define([_AM_COND_VALUE_$1], [$2])dnl 134 | if $2; then 135 | $1_TRUE= 136 | $1_FALSE='#' 137 | else 138 | $1_TRUE='#' 139 | $1_FALSE= 140 | fi 141 | AC_CONFIG_COMMANDS_PRE( 142 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 143 | AC_MSG_ERROR([[conditional "$1" was never defined. 144 | Usually this means the macro was only invoked conditionally.]]) 145 | fi])]) 146 | 147 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148 | # Free Software Foundation, Inc. 149 | # 150 | # This file is free software; the Free Software Foundation 151 | # gives unlimited permission to copy and/or distribute it, 152 | # with or without modifications, as long as this notice is preserved. 153 | 154 | # serial 10 155 | 156 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157 | # written in clear, in which case automake, when reading aclocal.m4, 158 | # will think it sees a *use*, and therefore will trigger all it's 159 | # C support machinery. Also note that it means that autoscan, seeing 160 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 161 | 162 | 163 | # _AM_DEPENDENCIES(NAME) 164 | # ---------------------- 165 | # See how the compiler implements dependency checking. 166 | # NAME is "CC", "CXX", "GCJ", or "OBJC". 167 | # We try a few techniques and use that to set a single cache variable. 168 | # 169 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171 | # dependency, and given that the user is not expected to run this macro, 172 | # just rely on AC_PROG_CC. 173 | AC_DEFUN([_AM_DEPENDENCIES], 174 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 175 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 177 | AC_REQUIRE([AM_DEP_TRACK])dnl 178 | 179 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180 | [$1], CXX, [depcc="$CXX" am_compiler_list=], 181 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182 | [$1], UPC, [depcc="$UPC" am_compiler_list=], 183 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184 | [depcc="$$1" am_compiler_list=]) 185 | 186 | AC_CACHE_CHECK([dependency style of $depcc], 187 | [am_cv_$1_dependencies_compiler_type], 188 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189 | # We make a subdir and do the tests there. Otherwise we can end up 190 | # making bogus files that we don't know about and never remove. For 191 | # instance it was reported that on HP-UX the gcc test will end up 192 | # making a dummy file named `D' -- because `-MD' means `put the output 193 | # in D'. 194 | mkdir conftest.dir 195 | # Copy depcomp to subdir because otherwise we won't find it if we're 196 | # using a relative directory. 197 | cp "$am_depcomp" conftest.dir 198 | cd conftest.dir 199 | # We will build objects and dependencies in a subdirectory because 200 | # it helps to detect inapplicable dependency modes. For instance 201 | # both Tru64's cc and ICC support -MD to output dependencies as a 202 | # side effect of compilation, but ICC will put the dependencies in 203 | # the current directory while Tru64 will put them in the object 204 | # directory. 205 | mkdir sub 206 | 207 | am_cv_$1_dependencies_compiler_type=none 208 | if test "$am_compiler_list" = ""; then 209 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210 | fi 211 | am__universal=false 212 | m4_case([$1], [CC], 213 | [case " $depcc " in #( 214 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 215 | esac], 216 | [CXX], 217 | [case " $depcc " in #( 218 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 219 | esac]) 220 | 221 | for depmode in $am_compiler_list; do 222 | # Setup a source with many dependencies, because some compilers 223 | # like to wrap large dependency lists on column 80 (with \), and 224 | # we should not choose a depcomp mode which is confused by this. 225 | # 226 | # We need to recreate these files for each test, as the compiler may 227 | # overwrite some of them when testing with obscure command lines. 228 | # This happens at least with the AIX C compiler. 229 | : > sub/conftest.c 230 | for i in 1 2 3 4 5 6; do 231 | echo '#include "conftst'$i'.h"' >> sub/conftest.c 232 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 233 | # Solaris 8's {/usr,}/bin/sh. 234 | touch sub/conftst$i.h 235 | done 236 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237 | 238 | # We check with `-c' and `-o' for the sake of the "dashmstdout" 239 | # mode. It turns out that the SunPro C++ compiler does not properly 240 | # handle `-M -o', and we need to detect this. Also, some Intel 241 | # versions had trouble with output in subdirs 242 | am__obj=sub/conftest.${OBJEXT-o} 243 | am__minus_obj="-o $am__obj" 244 | case $depmode in 245 | gcc) 246 | # This depmode causes a compiler race in universal mode. 247 | test "$am__universal" = false || continue 248 | ;; 249 | nosideeffect) 250 | # after this tag, mechanisms are not by side-effect, so they'll 251 | # only be used when explicitly requested 252 | if test "x$enable_dependency_tracking" = xyes; then 253 | continue 254 | else 255 | break 256 | fi 257 | ;; 258 | msvisualcpp | msvcmsys) 259 | # This compiler won't grok `-c -o', but also, the minuso test has 260 | # not run yet. These depmodes are late enough in the game, and 261 | # so weak that their functioning should not be impacted. 262 | am__obj=conftest.${OBJEXT-o} 263 | am__minus_obj= 264 | ;; 265 | none) break ;; 266 | esac 267 | if depmode=$depmode \ 268 | source=sub/conftest.c object=$am__obj \ 269 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 270 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271 | >/dev/null 2>conftest.err && 272 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 274 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276 | # icc doesn't choke on unknown options, it will just issue warnings 277 | # or remarks (even with -Werror). So we grep stderr for any message 278 | # that says an option was ignored or not supported. 279 | # When given -MP, icc 7.0 and 7.1 complain thusly: 280 | # icc: Command line warning: ignoring option '-M'; no argument required 281 | # The diagnosis changed in icc 8.0: 282 | # icc: Command line remark: option '-MP' not supported 283 | if (grep 'ignoring option' conftest.err || 284 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285 | am_cv_$1_dependencies_compiler_type=$depmode 286 | break 287 | fi 288 | fi 289 | done 290 | 291 | cd .. 292 | rm -rf conftest.dir 293 | else 294 | am_cv_$1_dependencies_compiler_type=none 295 | fi 296 | ]) 297 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298 | AM_CONDITIONAL([am__fastdep$1], [ 299 | test "x$enable_dependency_tracking" != xno \ 300 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301 | ]) 302 | 303 | 304 | # AM_SET_DEPDIR 305 | # ------------- 306 | # Choose a directory name for dependency files. 307 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES 308 | AC_DEFUN([AM_SET_DEPDIR], 309 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311 | ]) 312 | 313 | 314 | # AM_DEP_TRACK 315 | # ------------ 316 | AC_DEFUN([AM_DEP_TRACK], 317 | [AC_ARG_ENABLE(dependency-tracking, 318 | [ --disable-dependency-tracking speeds up one-time build 319 | --enable-dependency-tracking do not reject slow dependency extractors]) 320 | if test "x$enable_dependency_tracking" != xno; then 321 | am_depcomp="$ac_aux_dir/depcomp" 322 | AMDEPBACKSLASH='\' 323 | fi 324 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325 | AC_SUBST([AMDEPBACKSLASH])dnl 326 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327 | ]) 328 | 329 | # Generate code to set up dependency tracking. -*- Autoconf -*- 330 | 331 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332 | # Free Software Foundation, Inc. 333 | # 334 | # This file is free software; the Free Software Foundation 335 | # gives unlimited permission to copy and/or distribute it, 336 | # with or without modifications, as long as this notice is preserved. 337 | 338 | #serial 5 339 | 340 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 341 | # ------------------------------ 342 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343 | [{ 344 | # Autoconf 2.62 quotes --file arguments for eval, but not when files 345 | # are listed without --file. Let's play safe and only enable the eval 346 | # if we detect the quoting. 347 | case $CONFIG_FILES in 348 | *\'*) eval set x "$CONFIG_FILES" ;; 349 | *) set x $CONFIG_FILES ;; 350 | esac 351 | shift 352 | for mf 353 | do 354 | # Strip MF so we end up with the name of the file. 355 | mf=`echo "$mf" | sed -e 's/:.*$//'` 356 | # Check whether this is an Automake generated Makefile or not. 357 | # We used to match only the files named `Makefile.in', but 358 | # some people rename them; so instead we look at the file content. 359 | # Grep'ing the first line is not enough: some people post-process 360 | # each Makefile.in and add a new line on top of each file to say so. 361 | # Grep'ing the whole file is not good either: AIX grep has a line 362 | # limit of 2048, but all sed's we know have understand at least 4000. 363 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 364 | dirpart=`AS_DIRNAME("$mf")` 365 | else 366 | continue 367 | fi 368 | # Extract the definition of DEPDIR, am__include, and am__quote 369 | # from the Makefile without running `make'. 370 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371 | test -z "$DEPDIR" && continue 372 | am__include=`sed -n 's/^am__include = //p' < "$mf"` 373 | test -z "am__include" && continue 374 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375 | # When using ansi2knr, U may be empty or an underscore; expand it 376 | U=`sed -n 's/^U = //p' < "$mf"` 377 | # Find all dependency output files, they are included files with 378 | # $(DEPDIR) in their names. We invoke sed twice because it is the 379 | # simplest approach to changing $(DEPDIR) to its actual value in the 380 | # expansion. 381 | for file in `sed -n " 382 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 384 | # Make sure the directory exists. 385 | test -f "$dirpart/$file" && continue 386 | fdir=`AS_DIRNAME(["$file"])` 387 | AS_MKDIR_P([$dirpart/$fdir]) 388 | # echo "creating $dirpart/$file" 389 | echo '# dummy' > "$dirpart/$file" 390 | done 391 | done 392 | } 393 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394 | 395 | 396 | # AM_OUTPUT_DEPENDENCY_COMMANDS 397 | # ----------------------------- 398 | # This macro should only be invoked once -- use via AC_REQUIRE. 399 | # 400 | # This code is only required when automatic dependency tracking 401 | # is enabled. FIXME. This creates each `.P' file that we will 402 | # need in order to bootstrap the dependency handling code. 403 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404 | [AC_CONFIG_COMMANDS([depfiles], 405 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407 | ]) 408 | 409 | # Do all the work for Automake. -*- Autoconf -*- 410 | 411 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 412 | # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 413 | # 414 | # This file is free software; the Free Software Foundation 415 | # gives unlimited permission to copy and/or distribute it, 416 | # with or without modifications, as long as this notice is preserved. 417 | 418 | # serial 16 419 | 420 | # This macro actually does too much. Some checks are only needed if 421 | # your package does certain things. But this isn't really a big deal. 422 | 423 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 424 | # AM_INIT_AUTOMAKE([OPTIONS]) 425 | # ----------------------------------------------- 426 | # The call with PACKAGE and VERSION arguments is the old style 427 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 428 | # and VERSION should now be passed to AC_INIT and removed from 429 | # the call to AM_INIT_AUTOMAKE. 430 | # We support both call styles for the transition. After 431 | # the next Automake release, Autoconf can make the AC_INIT 432 | # arguments mandatory, and then we can depend on a new Autoconf 433 | # release and drop the old call support. 434 | AC_DEFUN([AM_INIT_AUTOMAKE], 435 | [AC_PREREQ([2.62])dnl 436 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 437 | dnl the ones we care about. 438 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 439 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 440 | AC_REQUIRE([AC_PROG_INSTALL])dnl 441 | if test "`cd $srcdir && pwd`" != "`pwd`"; then 442 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 443 | # is not polluted with repeated "-I." 444 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 445 | # test to see if srcdir already configured 446 | if test -f $srcdir/config.status; then 447 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 448 | fi 449 | fi 450 | 451 | # test whether we have cygpath 452 | if test -z "$CYGPATH_W"; then 453 | if (cygpath --version) >/dev/null 2>/dev/null; then 454 | CYGPATH_W='cygpath -w' 455 | else 456 | CYGPATH_W=echo 457 | fi 458 | fi 459 | AC_SUBST([CYGPATH_W]) 460 | 461 | # Define the identity of the package. 462 | dnl Distinguish between old-style and new-style calls. 463 | m4_ifval([$2], 464 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 465 | AC_SUBST([PACKAGE], [$1])dnl 466 | AC_SUBST([VERSION], [$2])], 467 | [_AM_SET_OPTIONS([$1])dnl 468 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 469 | m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 470 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 471 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 472 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 473 | 474 | _AM_IF_OPTION([no-define],, 475 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 476 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 477 | 478 | # Some tools Automake needs. 479 | AC_REQUIRE([AM_SANITY_CHECK])dnl 480 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 481 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 482 | AM_MISSING_PROG(AUTOCONF, autoconf) 483 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 484 | AM_MISSING_PROG(AUTOHEADER, autoheader) 485 | AM_MISSING_PROG(MAKEINFO, makeinfo) 486 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 487 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 488 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl 489 | # We need awk for the "check" target. The system "awk" is bad on 490 | # some platforms. 491 | AC_REQUIRE([AC_PROG_AWK])dnl 492 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 493 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 494 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 495 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 496 | [_AM_PROG_TAR([v7])])]) 497 | _AM_IF_OPTION([no-dependencies],, 498 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 499 | [_AM_DEPENDENCIES(CC)], 500 | [define([AC_PROG_CC], 501 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 502 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 503 | [_AM_DEPENDENCIES(CXX)], 504 | [define([AC_PROG_CXX], 505 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 506 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], 507 | [_AM_DEPENDENCIES(OBJC)], 508 | [define([AC_PROG_OBJC], 509 | defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 510 | ]) 511 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 512 | dnl The `parallel-tests' driver may need to know about EXEEXT, so add the 513 | dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 514 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 515 | AC_CONFIG_COMMANDS_PRE(dnl 516 | [m4_provide_if([_AM_COMPILER_EXEEXT], 517 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 518 | ]) 519 | 520 | dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 521 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 522 | dnl mangled by Autoconf and run in a shell conditional statement. 523 | m4_define([_AC_COMPILER_EXEEXT], 524 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 525 | 526 | 527 | # When config.status generates a header, we must update the stamp-h file. 528 | # This file resides in the same directory as the config header 529 | # that is generated. The stamp files are numbered to have different names. 530 | 531 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 532 | # loop where config.status creates the headers, so we can generate 533 | # our stamp files there. 534 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 535 | [# Compute $1's index in $config_headers. 536 | _am_arg=$1 537 | _am_stamp_count=1 538 | for _am_header in $config_headers :; do 539 | case $_am_header in 540 | $_am_arg | $_am_arg:* ) 541 | break ;; 542 | * ) 543 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 544 | esac 545 | done 546 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 547 | 548 | # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 549 | # 550 | # This file is free software; the Free Software Foundation 551 | # gives unlimited permission to copy and/or distribute it, 552 | # with or without modifications, as long as this notice is preserved. 553 | 554 | # AM_PROG_INSTALL_SH 555 | # ------------------ 556 | # Define $install_sh. 557 | AC_DEFUN([AM_PROG_INSTALL_SH], 558 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 559 | if test x"${install_sh}" != xset; then 560 | case $am_aux_dir in 561 | *\ * | *\ *) 562 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 563 | *) 564 | install_sh="\${SHELL} $am_aux_dir/install-sh" 565 | esac 566 | fi 567 | AC_SUBST(install_sh)]) 568 | 569 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 570 | # 571 | # This file is free software; the Free Software Foundation 572 | # gives unlimited permission to copy and/or distribute it, 573 | # with or without modifications, as long as this notice is preserved. 574 | 575 | # serial 2 576 | 577 | # Check whether the underlying file-system supports filenames 578 | # with a leading dot. For instance MS-DOS doesn't. 579 | AC_DEFUN([AM_SET_LEADING_DOT], 580 | [rm -rf .tst 2>/dev/null 581 | mkdir .tst 2>/dev/null 582 | if test -d .tst; then 583 | am__leading_dot=. 584 | else 585 | am__leading_dot=_ 586 | fi 587 | rmdir .tst 2>/dev/null 588 | AC_SUBST([am__leading_dot])]) 589 | 590 | # Check to see how 'make' treats includes. -*- Autoconf -*- 591 | 592 | # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 593 | # 594 | # This file is free software; the Free Software Foundation 595 | # gives unlimited permission to copy and/or distribute it, 596 | # with or without modifications, as long as this notice is preserved. 597 | 598 | # serial 4 599 | 600 | # AM_MAKE_INCLUDE() 601 | # ----------------- 602 | # Check to see how make treats includes. 603 | AC_DEFUN([AM_MAKE_INCLUDE], 604 | [am_make=${MAKE-make} 605 | cat > confinc << 'END' 606 | am__doit: 607 | @echo this is the am__doit target 608 | .PHONY: am__doit 609 | END 610 | # If we don't find an include directive, just comment out the code. 611 | AC_MSG_CHECKING([for style of include used by $am_make]) 612 | am__include="#" 613 | am__quote= 614 | _am_result=none 615 | # First try GNU make style include. 616 | echo "include confinc" > confmf 617 | # Ignore all kinds of additional output from `make'. 618 | case `$am_make -s -f confmf 2> /dev/null` in #( 619 | *the\ am__doit\ target*) 620 | am__include=include 621 | am__quote= 622 | _am_result=GNU 623 | ;; 624 | esac 625 | # Now try BSD make style include. 626 | if test "$am__include" = "#"; then 627 | echo '.include "confinc"' > confmf 628 | case `$am_make -s -f confmf 2> /dev/null` in #( 629 | *the\ am__doit\ target*) 630 | am__include=.include 631 | am__quote="\"" 632 | _am_result=BSD 633 | ;; 634 | esac 635 | fi 636 | AC_SUBST([am__include]) 637 | AC_SUBST([am__quote]) 638 | AC_MSG_RESULT([$_am_result]) 639 | rm -f confinc confmf 640 | ]) 641 | 642 | # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 643 | # Free Software Foundation, Inc. 644 | # 645 | # This file is free software; the Free Software Foundation 646 | # gives unlimited permission to copy and/or distribute it, 647 | # with or without modifications, as long as this notice is preserved. 648 | 649 | # serial 6 650 | 651 | # AM_PROG_CC_C_O 652 | # -------------- 653 | # Like AC_PROG_CC_C_O, but changed for automake. 654 | AC_DEFUN([AM_PROG_CC_C_O], 655 | [AC_REQUIRE([AC_PROG_CC_C_O])dnl 656 | AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 657 | AC_REQUIRE_AUX_FILE([compile])dnl 658 | # FIXME: we rely on the cache variable name because 659 | # there is no other way. 660 | set dummy $CC 661 | am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` 662 | eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o 663 | if test "$am_t" != yes; then 664 | # Losing compiler, so override with the script. 665 | # FIXME: It is wrong to rewrite CC. 666 | # But if we don't then we get into trouble of one sort or another. 667 | # A longer-term fix would be to have automake use am__CC in this case, 668 | # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 669 | CC="$am_aux_dir/compile $CC" 670 | fi 671 | dnl Make sure AC_PROG_CC is never called again, or it will override our 672 | dnl setting of CC. 673 | m4_define([AC_PROG_CC], 674 | [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) 675 | ]) 676 | 677 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 678 | 679 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 680 | # Free Software Foundation, Inc. 681 | # 682 | # This file is free software; the Free Software Foundation 683 | # gives unlimited permission to copy and/or distribute it, 684 | # with or without modifications, as long as this notice is preserved. 685 | 686 | # serial 6 687 | 688 | # AM_MISSING_PROG(NAME, PROGRAM) 689 | # ------------------------------ 690 | AC_DEFUN([AM_MISSING_PROG], 691 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 692 | $1=${$1-"${am_missing_run}$2"} 693 | AC_SUBST($1)]) 694 | 695 | 696 | # AM_MISSING_HAS_RUN 697 | # ------------------ 698 | # Define MISSING if not defined so far and test if it supports --run. 699 | # If it does, set am_missing_run to use it, otherwise, to nothing. 700 | AC_DEFUN([AM_MISSING_HAS_RUN], 701 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 702 | AC_REQUIRE_AUX_FILE([missing])dnl 703 | if test x"${MISSING+set}" != xset; then 704 | case $am_aux_dir in 705 | *\ * | *\ *) 706 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 707 | *) 708 | MISSING="\${SHELL} $am_aux_dir/missing" ;; 709 | esac 710 | fi 711 | # Use eval to expand $SHELL 712 | if eval "$MISSING --run true"; then 713 | am_missing_run="$MISSING --run " 714 | else 715 | am_missing_run= 716 | AC_MSG_WARN([`missing' script is too old or missing]) 717 | fi 718 | ]) 719 | 720 | # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 721 | # 722 | # This file is free software; the Free Software Foundation 723 | # gives unlimited permission to copy and/or distribute it, 724 | # with or without modifications, as long as this notice is preserved. 725 | 726 | # AM_PROG_MKDIR_P 727 | # --------------- 728 | # Check for `mkdir -p'. 729 | AC_DEFUN([AM_PROG_MKDIR_P], 730 | [AC_PREREQ([2.60])dnl 731 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl 732 | dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 733 | dnl while keeping a definition of mkdir_p for backward compatibility. 734 | dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 735 | dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 736 | dnl Makefile.ins that do not define MKDIR_P, so we do our own 737 | dnl adjustment using top_builddir (which is defined more often than 738 | dnl MKDIR_P). 739 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 740 | case $mkdir_p in 741 | [[\\/$]]* | ?:[[\\/]]*) ;; 742 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 743 | esac 744 | ]) 745 | 746 | # Helper functions for option handling. -*- Autoconf -*- 747 | 748 | # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 749 | # 750 | # This file is free software; the Free Software Foundation 751 | # gives unlimited permission to copy and/or distribute it, 752 | # with or without modifications, as long as this notice is preserved. 753 | 754 | # serial 4 755 | 756 | # _AM_MANGLE_OPTION(NAME) 757 | # ----------------------- 758 | AC_DEFUN([_AM_MANGLE_OPTION], 759 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 760 | 761 | # _AM_SET_OPTION(NAME) 762 | # ------------------------------ 763 | # Set option NAME. Presently that only means defining a flag for this option. 764 | AC_DEFUN([_AM_SET_OPTION], 765 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 766 | 767 | # _AM_SET_OPTIONS(OPTIONS) 768 | # ---------------------------------- 769 | # OPTIONS is a space-separated list of Automake options. 770 | AC_DEFUN([_AM_SET_OPTIONS], 771 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 772 | 773 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 774 | # ------------------------------------------- 775 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 776 | AC_DEFUN([_AM_IF_OPTION], 777 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 778 | 779 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 780 | 781 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 782 | # Free Software Foundation, Inc. 783 | # 784 | # This file is free software; the Free Software Foundation 785 | # gives unlimited permission to copy and/or distribute it, 786 | # with or without modifications, as long as this notice is preserved. 787 | 788 | # serial 5 789 | 790 | # AM_SANITY_CHECK 791 | # --------------- 792 | AC_DEFUN([AM_SANITY_CHECK], 793 | [AC_MSG_CHECKING([whether build environment is sane]) 794 | # Just in case 795 | sleep 1 796 | echo timestamp > conftest.file 797 | # Reject unsafe characters in $srcdir or the absolute working directory 798 | # name. Accept space and tab only in the latter. 799 | am_lf=' 800 | ' 801 | case `pwd` in 802 | *[[\\\"\#\$\&\'\`$am_lf]]*) 803 | AC_MSG_ERROR([unsafe absolute working directory name]);; 804 | esac 805 | case $srcdir in 806 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 807 | AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 808 | esac 809 | 810 | # Do `set' in a subshell so we don't clobber the current shell's 811 | # arguments. Must try -L first in case configure is actually a 812 | # symlink; some systems play weird games with the mod time of symlinks 813 | # (eg FreeBSD returns the mod time of the symlink's containing 814 | # directory). 815 | if ( 816 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 817 | if test "$[*]" = "X"; then 818 | # -L didn't work. 819 | set X `ls -t "$srcdir/configure" conftest.file` 820 | fi 821 | rm -f conftest.file 822 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 823 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 824 | 825 | # If neither matched, then we have a broken ls. This can happen 826 | # if, for instance, CONFIG_SHELL is bash and it inherits a 827 | # broken ls alias from the environment. This has actually 828 | # happened. Such a system could not be considered "sane". 829 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 830 | alias in your environment]) 831 | fi 832 | 833 | test "$[2]" = conftest.file 834 | ) 835 | then 836 | # Ok. 837 | : 838 | else 839 | AC_MSG_ERROR([newly created file is older than distributed files! 840 | Check your system clock]) 841 | fi 842 | AC_MSG_RESULT(yes)]) 843 | 844 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 845 | # 846 | # This file is free software; the Free Software Foundation 847 | # gives unlimited permission to copy and/or distribute it, 848 | # with or without modifications, as long as this notice is preserved. 849 | 850 | # AM_PROG_INSTALL_STRIP 851 | # --------------------- 852 | # One issue with vendor `install' (even GNU) is that you can't 853 | # specify the program used to strip binaries. This is especially 854 | # annoying in cross-compiling environments, where the build's strip 855 | # is unlikely to handle the host's binaries. 856 | # Fortunately install-sh will honor a STRIPPROG variable, so we 857 | # always use install-sh in `make install-strip', and initialize 858 | # STRIPPROG with the value of the STRIP variable (set by the user). 859 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 860 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 861 | # Installed binaries are usually stripped using `strip' when the user 862 | # run `make install-strip'. However `strip' might not be the right 863 | # tool to use in cross-compilation environments, therefore Automake 864 | # will honor the `STRIP' environment variable to overrule this program. 865 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 866 | if test "$cross_compiling" != no; then 867 | AC_CHECK_TOOL([STRIP], [strip], :) 868 | fi 869 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 870 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 871 | 872 | # Copyright (C) 2006, 2008 Free Software Foundation, Inc. 873 | # 874 | # This file is free software; the Free Software Foundation 875 | # gives unlimited permission to copy and/or distribute it, 876 | # with or without modifications, as long as this notice is preserved. 877 | 878 | # serial 2 879 | 880 | # _AM_SUBST_NOTMAKE(VARIABLE) 881 | # --------------------------- 882 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 883 | # This macro is traced by Automake. 884 | AC_DEFUN([_AM_SUBST_NOTMAKE]) 885 | 886 | # AM_SUBST_NOTMAKE(VARIABLE) 887 | # --------------------------- 888 | # Public sister of _AM_SUBST_NOTMAKE. 889 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 890 | 891 | # Check how to create a tarball. -*- Autoconf -*- 892 | 893 | # Copyright (C) 2004, 2005 Free Software Foundation, Inc. 894 | # 895 | # This file is free software; the Free Software Foundation 896 | # gives unlimited permission to copy and/or distribute it, 897 | # with or without modifications, as long as this notice is preserved. 898 | 899 | # serial 2 900 | 901 | # _AM_PROG_TAR(FORMAT) 902 | # -------------------- 903 | # Check how to create a tarball in format FORMAT. 904 | # FORMAT should be one of `v7', `ustar', or `pax'. 905 | # 906 | # Substitute a variable $(am__tar) that is a command 907 | # writing to stdout a FORMAT-tarball containing the directory 908 | # $tardir. 909 | # tardir=directory && $(am__tar) > result.tar 910 | # 911 | # Substitute a variable $(am__untar) that extract such 912 | # a tarball read from stdin. 913 | # $(am__untar) < result.tar 914 | AC_DEFUN([_AM_PROG_TAR], 915 | [# Always define AMTAR for backward compatibility. 916 | AM_MISSING_PROG([AMTAR], [tar]) 917 | m4_if([$1], [v7], 918 | [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 919 | [m4_case([$1], [ustar],, [pax],, 920 | [m4_fatal([Unknown tar format])]) 921 | AC_MSG_CHECKING([how to create a $1 tar archive]) 922 | # Loop over all known methods to create a tar archive until one works. 923 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 924 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 925 | # Do not fold the above two line into one, because Tru64 sh and 926 | # Solaris sh will not grok spaces in the rhs of `-'. 927 | for _am_tool in $_am_tools 928 | do 929 | case $_am_tool in 930 | gnutar) 931 | for _am_tar in tar gnutar gtar; 932 | do 933 | AM_RUN_LOG([$_am_tar --version]) && break 934 | done 935 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 936 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 937 | am__untar="$_am_tar -xf -" 938 | ;; 939 | plaintar) 940 | # Must skip GNU tar: if it does not support --format= it doesn't create 941 | # ustar tarball either. 942 | (tar --version) >/dev/null 2>&1 && continue 943 | am__tar='tar chf - "$$tardir"' 944 | am__tar_='tar chf - "$tardir"' 945 | am__untar='tar xf -' 946 | ;; 947 | pax) 948 | am__tar='pax -L -x $1 -w "$$tardir"' 949 | am__tar_='pax -L -x $1 -w "$tardir"' 950 | am__untar='pax -r' 951 | ;; 952 | cpio) 953 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 954 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 955 | am__untar='cpio -i -H $1 -d' 956 | ;; 957 | none) 958 | am__tar=false 959 | am__tar_=false 960 | am__untar=false 961 | ;; 962 | esac 963 | 964 | # If the value was cached, stop now. We just wanted to have am__tar 965 | # and am__untar set. 966 | test -n "${am_cv_prog_tar_$1}" && break 967 | 968 | # tar/untar a dummy directory, and stop if the command works 969 | rm -rf conftest.dir 970 | mkdir conftest.dir 971 | echo GrepMe > conftest.dir/file 972 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 973 | rm -rf conftest.dir 974 | if test -s conftest.tar; then 975 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 977 | fi 978 | done 979 | rm -rf conftest.dir 980 | 981 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 982 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 983 | AC_SUBST([am__tar]) 984 | AC_SUBST([am__untar]) 985 | ]) # _AM_PROG_TAR 986 | 987 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # tcprstat -- Extract stats about TCP response times 5 | # Copyright (C) 2010 Ignacio Nin 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, write to the Free Software 19 | # Foundation, Inc., 20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | 23 | aclocal && 24 | autoheader && 25 | #libtoolize --automake && 26 | automake --add-missing && 27 | autoconf 28 | -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for compilers which do not understand `-c -o'. 3 | 4 | scriptversion=2009-10-06.20; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software 7 | # Foundation, Inc. 8 | # Written by Tom Tromey . 9 | # 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # This file is maintained in Automake, please report 29 | # bugs to or send patches to 30 | # . 31 | 32 | case $1 in 33 | '') 34 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 35 | exit 1; 36 | ;; 37 | -h | --h*) 38 | cat <<\EOF 39 | Usage: compile [--help] [--version] PROGRAM [ARGS] 40 | 41 | Wrapper for compilers which do not understand `-c -o'. 42 | Remove `-o dest.o' from ARGS, run PROGRAM with the remaining 43 | arguments, and rename the output as expected. 44 | 45 | If you are trying to build a whole package this is not the 46 | right script to run: please start by reading the file `INSTALL'. 47 | 48 | Report bugs to . 49 | EOF 50 | exit $? 51 | ;; 52 | -v | --v*) 53 | echo "compile $scriptversion" 54 | exit $? 55 | ;; 56 | esac 57 | 58 | ofile= 59 | cfile= 60 | eat= 61 | 62 | for arg 63 | do 64 | if test -n "$eat"; then 65 | eat= 66 | else 67 | case $1 in 68 | -o) 69 | # configure might choose to run compile as `compile cc -o foo foo.c'. 70 | # So we strip `-o arg' only if arg is an object. 71 | eat=1 72 | case $2 in 73 | *.o | *.obj) 74 | ofile=$2 75 | ;; 76 | *) 77 | set x "$@" -o "$2" 78 | shift 79 | ;; 80 | esac 81 | ;; 82 | *.c) 83 | cfile=$1 84 | set x "$@" "$1" 85 | shift 86 | ;; 87 | *) 88 | set x "$@" "$1" 89 | shift 90 | ;; 91 | esac 92 | fi 93 | shift 94 | done 95 | 96 | if test -z "$ofile" || test -z "$cfile"; then 97 | # If no `-o' option was seen then we might have been invoked from a 98 | # pattern rule where we don't need one. That is ok -- this is a 99 | # normal compilation that the losing compiler can handle. If no 100 | # `.c' file was seen then we are probably linking. That is also 101 | # ok. 102 | exec "$@" 103 | fi 104 | 105 | # Name of file we expect compiler to create. 106 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 107 | 108 | # Create the lock directory. 109 | # Note: use `[/\\:.-]' here to ensure that we don't use the same name 110 | # that we are using for the .o file. Also, base the name on the expected 111 | # object file name, since that is what matters with a parallel build. 112 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 113 | while true; do 114 | if mkdir "$lockdir" >/dev/null 2>&1; then 115 | break 116 | fi 117 | sleep 1 118 | done 119 | # FIXME: race condition here if user kills between mkdir and trap. 120 | trap "rmdir '$lockdir'; exit 1" 1 2 15 121 | 122 | # Run the compile. 123 | "$@" 124 | ret=$? 125 | 126 | if test -f "$cofile"; then 127 | test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 128 | elif test -f "${cofile}bj"; then 129 | test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 130 | fi 131 | 132 | rmdir "$lockdir" 133 | exit $ret 134 | 135 | # Local Variables: 136 | # mode: shell-script 137 | # sh-indentation: 2 138 | # eval: (add-hook 'write-file-hooks 'time-stamp) 139 | # time-stamp-start: "scriptversion=" 140 | # time-stamp-format: "%:y-%02m-%02d.%02H" 141 | # time-stamp-time-zone: "UTC" 142 | # time-stamp-end: "; # UTC" 143 | # End: 144 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | # 5 | # tcprstat -- Extract stats about TCP response times 6 | # Copyright (C) 2010 Ignacio Nin 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 21 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | # 23 | 24 | AC_PREREQ(2.61) 25 | AC_INIT([tcprstat], [0.3.1], [ignacio.nin@percona.com]) 26 | AM_INIT_AUTOMAKE([ ]) 27 | AC_CONFIG_HEADER([config.h]) 28 | 29 | # Checks for programs. 30 | AC_PROG_CC 31 | AM_PROG_CC_C_O 32 | AC_PROG_YACC 33 | AC_PROG_LEX 34 | 35 | # Checks for libraries. 36 | 37 | # Pcap static check 38 | save_LDFLAGS="$LDFLAGS" 39 | LDFLAGS=-static 40 | AC_CHECK_LIB([pcap], [pcap_open_live], , [buildpcap=yes]) 41 | LDFLAGS="$save_LDFLAGS" 42 | 43 | # Checks for header files. 44 | AC_CHECK_HEADERS( 45 | [arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/time.h unistd.h]) 46 | AC_CHECK_HEADER([pcap/sll.h], , [buildpcap=yes]) 47 | 48 | # Checks for typedefs, structures, and compiler characteristics. 49 | AC_TYPE_UINT16_T 50 | AC_CHECK_SIZEOF([unsigned long]) 51 | 52 | # Checks for library functions. 53 | AC_FUNC_MALLOC 54 | AC_FUNC_REALLOC 55 | AC_CHECK_FUNCS([gettimeofday inet_ntoa memset strdup strtol]) 56 | 57 | # Build our version of libpcap 58 | if test x$buildpcap == xyes 59 | then 60 | # We need flex and yacc 61 | if ! $YACC --version &>/dev/null 62 | then 63 | AC_MSG_ERROR( 64 | [Cannot build libpcap without bison or yacc. Please install either.]) 65 | elif test "x`$LEX --version`" == "x" 66 | then 67 | AC_MSG_ERROR( 68 | [Cannot build libpcap without flex. Please install.]) 69 | fi 70 | 71 | # Build our shipped version of libpcap. 72 | (cd libpcap && tar xzf libpcap*.tar.gz && cd libpcap*/ && 73 | patch -p1 < ../resolver-patch) || { 74 | AC_MSG_ERROR([error unpacking libpcap tar]) 75 | } 76 | 77 | LIBPCAP_SUBDIR=`echo libpcap/libpcap-*/` 78 | AC_SUBST(LIBPCAP_SUBDIR) 79 | 80 | AC_CONFIG_SUBDIRS([libpcap/libpcap-*/]) 81 | AC_CONFIG_FILES([libpcap/Makefile]) 82 | 83 | fi 84 | 85 | AM_CONDITIONAL(BUILD_PCAP, test x$buildpcap == xyes) 86 | 87 | AC_CONFIG_FILES([Makefile 88 | src/Makefile]) 89 | 90 | AC_OUTPUT 91 | -------------------------------------------------------------------------------- /libpcap/.gitignore: -------------------------------------------------------------------------------- 1 | # libpcap product 2 | libpcap-1.1.1 3 | -------------------------------------------------------------------------------- /libpcap/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # libpcap/Makefile. Generated from Makefile.in by configure. 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | 17 | 18 | # 19 | # tcprstat -- Extract stats about TCP response times 20 | # Copyright (C) 2010 Ignacio Nin 21 | # 22 | # This program is free software; you can redistribute it and/or modify 23 | # it under the terms of the GNU General Public License as published by 24 | # the Free Software Foundation; either version 2 of the License, or 25 | # (at your option) any later version. 26 | # 27 | # This program is distributed in the hope that it will be useful, 28 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | # GNU General Public License for more details. 31 | # 32 | # You should have received a copy of the GNU General Public License 33 | # along with this program; if not, write to the Free Software 34 | # Foundation, Inc., 35 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 36 | # 37 | 38 | pkgdatadir = $(datadir)/tcprstat 39 | pkgincludedir = $(includedir)/tcprstat 40 | pkglibdir = $(libdir)/tcprstat 41 | pkglibexecdir = $(libexecdir)/tcprstat 42 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 43 | install_sh_DATA = $(install_sh) -c -m 644 44 | install_sh_PROGRAM = $(install_sh) -c 45 | install_sh_SCRIPT = $(install_sh) -c 46 | INSTALL_HEADER = $(INSTALL_DATA) 47 | transform = $(program_transform_name) 48 | NORMAL_INSTALL = : 49 | PRE_INSTALL = : 50 | POST_INSTALL = : 51 | NORMAL_UNINSTALL = : 52 | PRE_UNINSTALL = : 53 | POST_UNINSTALL = : 54 | subdir = libpcap 55 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 56 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 57 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 58 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 59 | $(ACLOCAL_M4) 60 | mkinstalldirs = $(install_sh) -d 61 | CONFIG_HEADER = $(top_builddir)/config.h 62 | CONFIG_CLEAN_FILES = 63 | CONFIG_CLEAN_VPATH_FILES = 64 | SOURCES = 65 | DIST_SOURCES = 66 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 67 | ACLOCAL = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/missing --run aclocal-1.11 68 | AMTAR = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/missing --run tar 69 | AUTOCONF = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/missing --run autoconf 70 | AUTOHEADER = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/missing --run autoheader 71 | AUTOMAKE = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/missing --run automake-1.11 72 | AWK = gawk 73 | CC = gcc 74 | CCDEPMODE = depmode=gcc3 75 | CFLAGS = -g -O2 76 | CPP = gcc -E 77 | CPPFLAGS = 78 | CYGPATH_W = echo 79 | DEFS = -DHAVE_CONFIG_H 80 | DEPDIR = .deps 81 | ECHO_C = 82 | ECHO_N = -n 83 | ECHO_T = 84 | EGREP = /bin/grep -E 85 | EXEEXT = 86 | GREP = /bin/grep 87 | INSTALL = /usr/bin/install -c 88 | INSTALL_DATA = ${INSTALL} -m 644 89 | INSTALL_PROGRAM = ${INSTALL} 90 | INSTALL_SCRIPT = ${INSTALL} 91 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s 92 | LDFLAGS = 93 | LEX = flex 94 | LEXLIB = 95 | LEX_OUTPUT_ROOT = lex.yy 96 | LIBOBJS = 97 | LIBPCAP_SUBDIR = libpcap/libpcap-1.1.1/ 98 | LIBS = 99 | LTLIBOBJS = 100 | MAKEINFO = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/missing --run makeinfo 101 | MKDIR_P = /bin/mkdir -p 102 | OBJEXT = o 103 | PACKAGE = tcprstat 104 | PACKAGE_BUGREPORT = ignacio.nin@percona.com 105 | PACKAGE_NAME = tcprstat 106 | PACKAGE_STRING = tcprstat 0.3.1 107 | PACKAGE_TARNAME = tcprstat 108 | PACKAGE_URL = 109 | PACKAGE_VERSION = 0.3.1 110 | PATH_SEPARATOR = : 111 | SET_MAKE = 112 | SHELL = /bin/sh 113 | STRIP = 114 | VERSION = 0.3.1 115 | YACC = bison -y 116 | YFLAGS = 117 | abs_builddir = /root/yangyazhou/git_yyz/tcprstat/libpcap 118 | abs_srcdir = /root/yangyazhou/git_yyz/tcprstat/libpcap 119 | abs_top_builddir = /root/yangyazhou/git_yyz/tcprstat 120 | abs_top_srcdir = /root/yangyazhou/git_yyz/tcprstat 121 | ac_ct_CC = gcc 122 | am__include = include 123 | am__leading_dot = . 124 | am__quote = 125 | am__tar = ${AMTAR} chof - "$$tardir" 126 | am__untar = ${AMTAR} xf - 127 | bindir = ${exec_prefix}/bin 128 | build_alias = 129 | builddir = . 130 | datadir = ${datarootdir} 131 | datarootdir = ${prefix}/share 132 | docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} 133 | dvidir = ${docdir} 134 | exec_prefix = ${prefix} 135 | host_alias = 136 | htmldir = ${docdir} 137 | includedir = ${prefix}/include 138 | infodir = ${datarootdir}/info 139 | install_sh = ${SHELL} /root/yangyazhou/git_yyz/tcprstat/install-sh 140 | libdir = ${exec_prefix}/lib 141 | libexecdir = ${exec_prefix}/libexec 142 | localedir = ${datarootdir}/locale 143 | localstatedir = ${prefix}/var 144 | mandir = ${datarootdir}/man 145 | mkdir_p = /bin/mkdir -p 146 | oldincludedir = /usr/include 147 | pdfdir = ${docdir} 148 | prefix = /usr/local 149 | program_transform_name = s,x,x, 150 | psdir = ${docdir} 151 | sbindir = ${exec_prefix}/sbin 152 | sharedstatedir = ${prefix}/com 153 | srcdir = . 154 | subdirs = libpcap/libpcap-*/ 155 | sysconfdir = ${prefix}/etc 156 | target_alias = 157 | top_build_prefix = ../ 158 | top_builddir = .. 159 | top_srcdir = .. 160 | EXTRA_DIST = libpcap-*.tar.gz resolver-patch 161 | all: all-am 162 | 163 | .SUFFIXES: 164 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 165 | @for dep in $?; do \ 166 | case '$(am__configure_deps)' in \ 167 | *$$dep*) \ 168 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 169 | && { if test -f $@; then exit 0; else break; fi; }; \ 170 | exit 1;; \ 171 | esac; \ 172 | done; \ 173 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libpcap/Makefile'; \ 174 | $(am__cd) $(top_srcdir) && \ 175 | $(AUTOMAKE) --gnu libpcap/Makefile 176 | .PRECIOUS: Makefile 177 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 178 | @case '$?' in \ 179 | *config.status*) \ 180 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 181 | *) \ 182 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 183 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 184 | esac; 185 | 186 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 187 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 188 | 189 | $(top_srcdir)/configure: $(am__configure_deps) 190 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 191 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 192 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 193 | $(am__aclocal_m4_deps): 194 | tags: TAGS 195 | TAGS: 196 | 197 | ctags: CTAGS 198 | CTAGS: 199 | 200 | 201 | distdir: $(DISTFILES) 202 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 203 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 204 | list='$(DISTFILES)'; \ 205 | dist_files=`for file in $$list; do echo $$file; done | \ 206 | sed -e "s|^$$srcdirstrip/||;t" \ 207 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 208 | case $$dist_files in \ 209 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 210 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 211 | sort -u` ;; \ 212 | esac; \ 213 | for file in $$dist_files; do \ 214 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 215 | if test -d $$d/$$file; then \ 216 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 217 | if test -d "$(distdir)/$$file"; then \ 218 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 219 | fi; \ 220 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 221 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 222 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 223 | fi; \ 224 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 225 | else \ 226 | test -f "$(distdir)/$$file" \ 227 | || cp -p $$d/$$file "$(distdir)/$$file" \ 228 | || exit 1; \ 229 | fi; \ 230 | done 231 | check-am: all-am 232 | check: check-am 233 | all-am: Makefile all-local 234 | installdirs: 235 | install: install-am 236 | install-exec: install-exec-am 237 | install-data: install-data-am 238 | uninstall: uninstall-am 239 | 240 | install-am: all-am 241 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 242 | 243 | installcheck: installcheck-am 244 | install-strip: 245 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 246 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 247 | `test -z '$(STRIP)' || \ 248 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 249 | mostlyclean-generic: 250 | 251 | clean-generic: 252 | 253 | distclean-generic: 254 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 255 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 256 | 257 | maintainer-clean-generic: 258 | @echo "This command is intended for maintainers to use" 259 | @echo "it deletes files that may require special tools to rebuild." 260 | clean: clean-am 261 | 262 | clean-am: clean-generic clean-local mostlyclean-am 263 | 264 | distclean-am: clean-am distclean-generic 265 | 266 | dvi: dvi-am 267 | 268 | dvi-am: 269 | 270 | html: html-am 271 | 272 | html-am: 273 | 274 | info: info-am 275 | 276 | info-am: 277 | 278 | install-data-am: 279 | 280 | install-dvi: install-dvi-am 281 | 282 | install-dvi-am: 283 | 284 | install-exec-am: 285 | 286 | install-html: install-html-am 287 | 288 | install-html-am: 289 | 290 | install-info: install-info-am 291 | 292 | install-info-am: 293 | 294 | install-man: 295 | 296 | install-pdf: install-pdf-am 297 | 298 | install-pdf-am: 299 | 300 | install-ps: install-ps-am 301 | 302 | install-ps-am: 303 | 304 | installcheck-am: 305 | 306 | maintainer-clean: maintainer-clean-am 307 | -rm -f Makefile 308 | maintainer-clean-am: distclean-am maintainer-clean-generic 309 | 310 | mostlyclean: mostlyclean-am 311 | 312 | mostlyclean-am: mostlyclean-generic 313 | 314 | pdf: pdf-am 315 | 316 | pdf-am: 317 | 318 | ps: ps-am 319 | 320 | ps-am: 321 | 322 | uninstall-am: 323 | 324 | .MAKE: install-am install-strip 325 | 326 | .PHONY: all all-am all-local check check-am clean clean-generic \ 327 | clean-local distclean distclean-generic distdir dvi dvi-am \ 328 | html html-am info info-am install install-am install-data \ 329 | install-data-am install-dvi install-dvi-am install-exec \ 330 | install-exec-am install-html install-html-am install-info \ 331 | install-info-am install-man install-pdf install-pdf-am \ 332 | install-ps install-ps-am install-strip installcheck \ 333 | installcheck-am installdirs maintainer-clean \ 334 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ 335 | pdf-am ps ps-am uninstall uninstall-am 336 | 337 | 338 | all-local: 339 | (cd libpcap-*/ && $(MAKE) libpcap.a) 340 | 341 | clean-local: 342 | (cd libpcap-*/ && $(MAKE) clean) 343 | 344 | distclean: 345 | rm -rf libpcap-*/ 346 | 347 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 348 | # Otherwise a system limit (for SysV at least) may be exceeded. 349 | .NOEXPORT: 350 | -------------------------------------------------------------------------------- /libpcap/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # tcprstat -- Extract stats about TCP response times 3 | # Copyright (C) 2010 Ignacio Nin 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | all-local: 22 | (cd libpcap-*/ && $(MAKE) libpcap.a) 23 | 24 | clean-local: 25 | (cd libpcap-*/ && $(MAKE) clean) 26 | 27 | distclean: 28 | rm -rf libpcap-*/ 29 | 30 | EXTRA_DIST = libpcap-*.tar.gz resolver-patch 31 | -------------------------------------------------------------------------------- /libpcap/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | # 19 | # tcprstat -- Extract stats about TCP response times 20 | # Copyright (C) 2010 Ignacio Nin 21 | # 22 | # This program is free software; you can redistribute it and/or modify 23 | # it under the terms of the GNU General Public License as published by 24 | # the Free Software Foundation; either version 2 of the License, or 25 | # (at your option) any later version. 26 | # 27 | # This program is distributed in the hope that it will be useful, 28 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | # GNU General Public License for more details. 31 | # 32 | # You should have received a copy of the GNU General Public License 33 | # along with this program; if not, write to the Free Software 34 | # Foundation, Inc., 35 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 36 | # 37 | VPATH = @srcdir@ 38 | pkgdatadir = $(datadir)/@PACKAGE@ 39 | pkgincludedir = $(includedir)/@PACKAGE@ 40 | pkglibdir = $(libdir)/@PACKAGE@ 41 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 42 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 43 | install_sh_DATA = $(install_sh) -c -m 644 44 | install_sh_PROGRAM = $(install_sh) -c 45 | install_sh_SCRIPT = $(install_sh) -c 46 | INSTALL_HEADER = $(INSTALL_DATA) 47 | transform = $(program_transform_name) 48 | NORMAL_INSTALL = : 49 | PRE_INSTALL = : 50 | POST_INSTALL = : 51 | NORMAL_UNINSTALL = : 52 | PRE_UNINSTALL = : 53 | POST_UNINSTALL = : 54 | subdir = libpcap 55 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 56 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 57 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 58 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 59 | $(ACLOCAL_M4) 60 | mkinstalldirs = $(install_sh) -d 61 | CONFIG_HEADER = $(top_builddir)/config.h 62 | CONFIG_CLEAN_FILES = 63 | CONFIG_CLEAN_VPATH_FILES = 64 | SOURCES = 65 | DIST_SOURCES = 66 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 67 | ACLOCAL = @ACLOCAL@ 68 | AMTAR = @AMTAR@ 69 | AUTOCONF = @AUTOCONF@ 70 | AUTOHEADER = @AUTOHEADER@ 71 | AUTOMAKE = @AUTOMAKE@ 72 | AWK = @AWK@ 73 | CC = @CC@ 74 | CCDEPMODE = @CCDEPMODE@ 75 | CFLAGS = @CFLAGS@ 76 | CPP = @CPP@ 77 | CPPFLAGS = @CPPFLAGS@ 78 | CYGPATH_W = @CYGPATH_W@ 79 | DEFS = @DEFS@ 80 | DEPDIR = @DEPDIR@ 81 | ECHO_C = @ECHO_C@ 82 | ECHO_N = @ECHO_N@ 83 | ECHO_T = @ECHO_T@ 84 | EGREP = @EGREP@ 85 | EXEEXT = @EXEEXT@ 86 | GREP = @GREP@ 87 | INSTALL = @INSTALL@ 88 | INSTALL_DATA = @INSTALL_DATA@ 89 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 90 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 91 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 92 | LDFLAGS = @LDFLAGS@ 93 | LEX = @LEX@ 94 | LEXLIB = @LEXLIB@ 95 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 96 | LIBOBJS = @LIBOBJS@ 97 | LIBPCAP_SUBDIR = @LIBPCAP_SUBDIR@ 98 | LIBS = @LIBS@ 99 | LTLIBOBJS = @LTLIBOBJS@ 100 | MAKEINFO = @MAKEINFO@ 101 | MKDIR_P = @MKDIR_P@ 102 | OBJEXT = @OBJEXT@ 103 | PACKAGE = @PACKAGE@ 104 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 105 | PACKAGE_NAME = @PACKAGE_NAME@ 106 | PACKAGE_STRING = @PACKAGE_STRING@ 107 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 108 | PACKAGE_URL = @PACKAGE_URL@ 109 | PACKAGE_VERSION = @PACKAGE_VERSION@ 110 | PATH_SEPARATOR = @PATH_SEPARATOR@ 111 | SET_MAKE = @SET_MAKE@ 112 | SHELL = @SHELL@ 113 | STRIP = @STRIP@ 114 | VERSION = @VERSION@ 115 | YACC = @YACC@ 116 | YFLAGS = @YFLAGS@ 117 | abs_builddir = @abs_builddir@ 118 | abs_srcdir = @abs_srcdir@ 119 | abs_top_builddir = @abs_top_builddir@ 120 | abs_top_srcdir = @abs_top_srcdir@ 121 | ac_ct_CC = @ac_ct_CC@ 122 | am__include = @am__include@ 123 | am__leading_dot = @am__leading_dot@ 124 | am__quote = @am__quote@ 125 | am__tar = @am__tar@ 126 | am__untar = @am__untar@ 127 | bindir = @bindir@ 128 | build_alias = @build_alias@ 129 | builddir = @builddir@ 130 | datadir = @datadir@ 131 | datarootdir = @datarootdir@ 132 | docdir = @docdir@ 133 | dvidir = @dvidir@ 134 | exec_prefix = @exec_prefix@ 135 | host_alias = @host_alias@ 136 | htmldir = @htmldir@ 137 | includedir = @includedir@ 138 | infodir = @infodir@ 139 | install_sh = @install_sh@ 140 | libdir = @libdir@ 141 | libexecdir = @libexecdir@ 142 | localedir = @localedir@ 143 | localstatedir = @localstatedir@ 144 | mandir = @mandir@ 145 | mkdir_p = @mkdir_p@ 146 | oldincludedir = @oldincludedir@ 147 | pdfdir = @pdfdir@ 148 | prefix = @prefix@ 149 | program_transform_name = @program_transform_name@ 150 | psdir = @psdir@ 151 | sbindir = @sbindir@ 152 | sharedstatedir = @sharedstatedir@ 153 | srcdir = @srcdir@ 154 | subdirs = @subdirs@ 155 | sysconfdir = @sysconfdir@ 156 | target_alias = @target_alias@ 157 | top_build_prefix = @top_build_prefix@ 158 | top_builddir = @top_builddir@ 159 | top_srcdir = @top_srcdir@ 160 | EXTRA_DIST = libpcap-*.tar.gz resolver-patch 161 | all: all-am 162 | 163 | .SUFFIXES: 164 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 165 | @for dep in $?; do \ 166 | case '$(am__configure_deps)' in \ 167 | *$$dep*) \ 168 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 169 | && { if test -f $@; then exit 0; else break; fi; }; \ 170 | exit 1;; \ 171 | esac; \ 172 | done; \ 173 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libpcap/Makefile'; \ 174 | $(am__cd) $(top_srcdir) && \ 175 | $(AUTOMAKE) --gnu libpcap/Makefile 176 | .PRECIOUS: Makefile 177 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 178 | @case '$?' in \ 179 | *config.status*) \ 180 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 181 | *) \ 182 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 183 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 184 | esac; 185 | 186 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 187 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 188 | 189 | $(top_srcdir)/configure: $(am__configure_deps) 190 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 191 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 192 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 193 | $(am__aclocal_m4_deps): 194 | tags: TAGS 195 | TAGS: 196 | 197 | ctags: CTAGS 198 | CTAGS: 199 | 200 | 201 | distdir: $(DISTFILES) 202 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 203 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 204 | list='$(DISTFILES)'; \ 205 | dist_files=`for file in $$list; do echo $$file; done | \ 206 | sed -e "s|^$$srcdirstrip/||;t" \ 207 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 208 | case $$dist_files in \ 209 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 210 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 211 | sort -u` ;; \ 212 | esac; \ 213 | for file in $$dist_files; do \ 214 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 215 | if test -d $$d/$$file; then \ 216 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 217 | if test -d "$(distdir)/$$file"; then \ 218 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 219 | fi; \ 220 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 221 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 222 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 223 | fi; \ 224 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 225 | else \ 226 | test -f "$(distdir)/$$file" \ 227 | || cp -p $$d/$$file "$(distdir)/$$file" \ 228 | || exit 1; \ 229 | fi; \ 230 | done 231 | check-am: all-am 232 | check: check-am 233 | all-am: Makefile all-local 234 | installdirs: 235 | install: install-am 236 | install-exec: install-exec-am 237 | install-data: install-data-am 238 | uninstall: uninstall-am 239 | 240 | install-am: all-am 241 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 242 | 243 | installcheck: installcheck-am 244 | install-strip: 245 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 246 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 247 | `test -z '$(STRIP)' || \ 248 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 249 | mostlyclean-generic: 250 | 251 | clean-generic: 252 | 253 | distclean-generic: 254 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 255 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 256 | 257 | maintainer-clean-generic: 258 | @echo "This command is intended for maintainers to use" 259 | @echo "it deletes files that may require special tools to rebuild." 260 | clean: clean-am 261 | 262 | clean-am: clean-generic clean-local mostlyclean-am 263 | 264 | distclean-am: clean-am distclean-generic 265 | 266 | dvi: dvi-am 267 | 268 | dvi-am: 269 | 270 | html: html-am 271 | 272 | html-am: 273 | 274 | info: info-am 275 | 276 | info-am: 277 | 278 | install-data-am: 279 | 280 | install-dvi: install-dvi-am 281 | 282 | install-dvi-am: 283 | 284 | install-exec-am: 285 | 286 | install-html: install-html-am 287 | 288 | install-html-am: 289 | 290 | install-info: install-info-am 291 | 292 | install-info-am: 293 | 294 | install-man: 295 | 296 | install-pdf: install-pdf-am 297 | 298 | install-pdf-am: 299 | 300 | install-ps: install-ps-am 301 | 302 | install-ps-am: 303 | 304 | installcheck-am: 305 | 306 | maintainer-clean: maintainer-clean-am 307 | -rm -f Makefile 308 | maintainer-clean-am: distclean-am maintainer-clean-generic 309 | 310 | mostlyclean: mostlyclean-am 311 | 312 | mostlyclean-am: mostlyclean-generic 313 | 314 | pdf: pdf-am 315 | 316 | pdf-am: 317 | 318 | ps: ps-am 319 | 320 | ps-am: 321 | 322 | uninstall-am: 323 | 324 | .MAKE: install-am install-strip 325 | 326 | .PHONY: all all-am all-local check check-am clean clean-generic \ 327 | clean-local distclean distclean-generic distdir dvi dvi-am \ 328 | html html-am info info-am install install-am install-data \ 329 | install-data-am install-dvi install-dvi-am install-exec \ 330 | install-exec-am install-html install-html-am install-info \ 331 | install-info-am install-man install-pdf install-pdf-am \ 332 | install-ps install-ps-am install-strip installcheck \ 333 | installcheck-am installdirs maintainer-clean \ 334 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ 335 | pdf-am ps ps-am uninstall uninstall-am 336 | 337 | 338 | all-local: 339 | (cd libpcap-*/ && $(MAKE) libpcap.a) 340 | 341 | clean-local: 342 | (cd libpcap-*/ && $(MAKE) clean) 343 | 344 | distclean: 345 | rm -rf libpcap-*/ 346 | 347 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 348 | # Otherwise a system limit (for SysV at least) may be exceeded. 349 | .NOEXPORT: 350 | -------------------------------------------------------------------------------- /libpcap/libpcap-1.1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/libpcap/libpcap-1.1.1.tar.gz -------------------------------------------------------------------------------- /libpcap/resolver-patch: -------------------------------------------------------------------------------- 1 | # 2 | # tcprstat -- Extract stats about TCP response times 3 | # Copyright (C) 2010 Ignacio Nin 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | # 22 | # RATIONALE 23 | # 24 | # This patch is for the successful linking of tcprstat-static, the 25 | # statically-linked version of tcprstat. 26 | # 27 | # gethostbyname(3) and friends, when linked statically, require at runtime the 28 | # C library where they were compiled. We actually don't use names in this 29 | # application for now, so it's safe (given the advantages of statically linking 30 | # tcprstat) to just return an error. 31 | # 32 | 33 | diff -Naur libpcap-1.1.1/nametoaddr.c libpcap-1.1.1-patch/nametoaddr.c 34 | --- libpcap-1.1.1/nametoaddr.c 2010-03-11 23:56:54.000000000 -0200 35 | +++ libpcap-1.1.1-patch/nametoaddr.c 2010-05-22 03:28:15.613054061 -0300 36 | @@ -98,6 +98,7 @@ 37 | bpf_u_int32 ** 38 | pcap_nametoaddr(const char *name) 39 | { 40 | +#if 0 41 | #ifndef h_addr 42 | static bpf_u_int32 *hlist[2]; 43 | #endif 44 | @@ -117,12 +118,16 @@ 45 | } 46 | else 47 | return 0; 48 | +#else 49 | + return 0; 50 | +#endif 51 | } 52 | 53 | #ifdef INET6 54 | struct addrinfo * 55 | pcap_nametoaddrinfo(const char *name) 56 | { 57 | +#if 0 58 | struct addrinfo hints, *res; 59 | int error; 60 | 61 | @@ -135,6 +140,9 @@ 62 | return NULL; 63 | else 64 | return res; 65 | +#else 66 | + return NULL; 67 | +#endif 68 | } 69 | #endif /*INET6*/ 70 | 71 | @@ -145,6 +153,7 @@ 72 | bpf_u_int32 73 | pcap_nametonetaddr(const char *name) 74 | { 75 | +#if 0 76 | #ifndef WIN32 77 | struct netent *np; 78 | 79 | @@ -158,6 +167,9 @@ 80 | */ 81 | return 0; 82 | #endif 83 | +#else 84 | + return 0; 85 | +#endif 86 | } 87 | 88 | /* 89 | @@ -168,6 +180,7 @@ 90 | int 91 | pcap_nametoport(const char *name, int *port, int *proto) 92 | { 93 | +#if 0 94 | struct servent *sp; 95 | int tcp_port = -1; 96 | int udp_port = -1; 97 | @@ -212,6 +225,9 @@ 98 | } 99 | #endif 100 | return 0; 101 | +#else 102 | + return 0; 103 | +#endif 104 | } 105 | 106 | /* 107 | @@ -262,6 +278,7 @@ 108 | int 109 | pcap_nametoproto(const char *str) 110 | { 111 | +#if 0 112 | struct protoent *p; 113 | 114 | p = getprotobyname(str); 115 | @@ -269,6 +286,9 @@ 116 | return p->p_proto; 117 | else 118 | return PROTO_UNDEF; 119 | +#else 120 | + return PROTO_UNDEF; 121 | +#endif 122 | } 123 | 124 | #include "ethertype.h" 125 | diff -Naur libpcap-1.1.1/scanner.l libpcap-1.1.1-patch/scanner.l 126 | --- libpcap-1.1.1/scanner.l 2010-03-11 23:56:54.000000000 -0200 127 | +++ libpcap-1.1.1-patch/scanner.l 2010-05-22 03:29:32.435054976 -0300 128 | @@ -345,12 +345,16 @@ 129 | memset(&hints, 0, sizeof(hints)); 130 | hints.ai_family = AF_INET6; 131 | hints.ai_flags = AI_NUMERICHOST; 132 | +#if 0 133 | if (getaddrinfo(yytext, NULL, &hints, &res)) 134 | bpf_error("bogus IPv6 address %s", yytext); 135 | else { 136 | +#endif 137 | freeaddrinfo(res); 138 | yylval.s = sdup((char *)yytext); return HID6; 139 | +#if 0 140 | } 141 | +#endif 142 | #else 143 | bpf_error("IPv6 address %s not supported", yytext); 144 | #endif /*INET6*/ 145 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # tcprstat -- Extract stats about TCP response times 3 | # Copyright (C) 2010 Ignacio Nin 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | Makefile 21 | Makefile.in 22 | *.o 23 | tcprstat 24 | tcprstat-static 25 | .libs 26 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # tcprstat -- Extract stats about TCP response times 3 | # Copyright (C) 2010 Ignacio Nin 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | AM_CFLAGS = -Wall -Werror -g 22 | 23 | bin_PROGRAMS = tcprstat tcprstat-static 24 | tcprstat_SOURCES = tcprstat.h tcprstat.c functions.h functions.c capture.h \ 25 | capture.c process-packet.h process-packet.c local-addresses.h \ 26 | local-addresses.c stats.h stats.c output.h output.c stats-hash.h \ 27 | stats-hash.c 28 | tcprstat_static_SOURCES = $(tcprstat_SOURCES) 29 | 30 | if BUILD_PCAP 31 | tcprstat_CFLAGS = $(AM_CFLAGS) -pthread -I$(top_srcdir)/@LIBPCAP_SUBDIR@ 32 | tcprstat_LDFLAGS = $(AM_LDFLAGS) -L$(top_srcdir)/@LIBPCAP_SUBDIR@ -lpthread 33 | tcprstat_LDADD = -lpcap 34 | 35 | tcprstat_static_CFLAGS = $(AM_CFLAGS) -pthread -I$(top_srcdir)/@LIBPCAP_SUBDIR@ 36 | tcprstat_static_LDFLAGS = $(AM_LDFLAGS) -static -L$(top_srcdir)/@LIBPCAP_SUBDIR@ 37 | tcprstat_static_LDADD = -lpthread -lpcap 38 | 39 | else 40 | tcprstat_CFLAGS = $(AM_CFLAGS) -pthread 41 | tcprstat_LDFLAGS = $(AM_LDFLAGS) -lpthread -lpcap 42 | 43 | tcprstat_static_CFLAGS = $(AM_CFLAGS) -pthread 44 | tcprstat_static_LDFLAGS = $(AM_LDFLAGS) -static 45 | tcprstat_static_LDADD = -lpthread -lpcap 46 | 47 | endif 48 | -------------------------------------------------------------------------------- /src/capture.c: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #include "tcprstat.h" 23 | #include "capture.h" 24 | #include "process-packet.h" 25 | 26 | #include 27 | 28 | pcap_t *pcap; 29 | 30 | void * 31 | capture(void *arg) { 32 | struct bpf_program bpf; 33 | char errbuf[PCAP_ERRBUF_SIZE]; 34 | char filter[30]; 35 | int r; 36 | 37 | // Second argument 0 stands for non-promiscuous mode 38 | pcap = pcap_open_live("any", CAPTURE_LENGTH, 0, READ_TIMEOUT, errbuf); 39 | if (!pcap) { 40 | fprintf(stderr, "pcap: %s\n", errbuf); 41 | return NULL; 42 | 43 | } 44 | 45 | // Capture only TCP 46 | if (port) 47 | sprintf(filter, "tcp port %d", port); 48 | else 49 | sprintf(filter, "tcp"); 50 | 51 | if (pcap_compile(pcap, &bpf, filter, 1, 0)) { 52 | fprintf(stderr, "pcap: %s\n", pcap_geterr(pcap)); 53 | return NULL; 54 | 55 | } 56 | 57 | if (pcap_setfilter(pcap, &bpf)) { 58 | fprintf(stderr, "pcap: %s\n", pcap_geterr(pcap)); 59 | return NULL; 60 | 61 | } 62 | 63 | // The -1 here stands for "infinity" 64 | r = pcap_loop(pcap, -1, process_packet, (unsigned char *) pcap); 65 | if (r == -1) { 66 | fprintf(stderr, "pcap: %s\n", pcap_geterr(pcap)); 67 | return NULL; 68 | 69 | } 70 | 71 | return NULL; 72 | 73 | } 74 | 75 | int 76 | offline_capture(FILE *fcapture) { 77 | struct bpf_program bpf; 78 | char errbuf[PCAP_ERRBUF_SIZE]; 79 | char filter[30]; 80 | int r; 81 | 82 | pcap = pcap_fopen_offline(fcapture, errbuf); 83 | if (!pcap) { 84 | fprintf(stderr, "pcap: %s\n", errbuf); 85 | return 1; 86 | 87 | } 88 | 89 | // Capture only TCP 90 | if (port) 91 | sprintf(filter, "tcp port %d", port); 92 | else 93 | sprintf(filter, "tcp"); 94 | 95 | if (pcap_compile(pcap, &bpf, filter, 1, 0)) { 96 | fprintf(stderr, "pcap: %s\n", pcap_geterr(pcap)); 97 | return 1; 98 | 99 | } 100 | 101 | if (pcap_setfilter(pcap, &bpf)) { 102 | fprintf(stderr, "pcap: %s\n", pcap_geterr(pcap)); 103 | return 1; 104 | 105 | } 106 | 107 | // The -1 here stands for "infinity" 108 | r = pcap_loop(pcap, -1, process_packet, (unsigned char *) pcap); 109 | if (r == -1) { 110 | fprintf(stderr, "pcap: %s\n", pcap_geterr(pcap)); 111 | return 1; 112 | 113 | } 114 | 115 | return 1; 116 | 117 | } 118 | 119 | void 120 | endcapture(void) { 121 | if (pcap) 122 | pcap_breakloop(pcap); 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/capture.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #if !defined CAPTURE_H 23 | #define CAPTURE_H 24 | 25 | #include 26 | 27 | #define CAPTURE_LENGTH 65535 28 | #define READ_TIMEOUT 2000 29 | 30 | void *capture(void *); 31 | void endcapture(void); 32 | 33 | int offline_capture(FILE *); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/functions.c: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #include 23 | #include 24 | 25 | #include "config.h" 26 | #include "functions.h" 27 | #include "tcprstat.h" 28 | 29 | char *usage_msg = 30 | "Usage: %s [--port ] [--format=] [--interval=]\n" 31 | " [--header[=
] | --no-header] [--iterations=]\n" 32 | " [--read=]\n" 33 | " %s --version | --help\n" 34 | "\n" 35 | "\t--read , -r Capture from pcap file , not live.\n" 36 | "\t--time , -T time delay > -T(time) count stastic.\n" 37 | "\t--log , -o if time dealy > -T(time), timestamp record to log file.\n" 38 | "\t--local , -l\n" 39 | "\t is a comma-separated list of ip\n" 40 | "\t addresses, which are used as the local list of\n" 41 | "\t addresses instead of pcap getting the list.\n" 42 | "\t This is useful when working with a pcap file got\n" 43 | "\t from another host with different addresses.\n" 44 | "\t--port , -p Capture traffic only for tcp/.\n" 45 | "\t--format , -f\n" 46 | "\t Output format. Argument is a string detailing\n" 47 | "\t how the information is presented. Accepted codes:\n" 48 | "\t %%n - Response time count\n" 49 | "\t %%a - Response time media in microseconds\n" 50 | "\t %%s - Response time sum\n" 51 | "\t %%x - Response time squares sum\n" 52 | "\t %%m - Minimum value\n" 53 | "\t %%M - Maximum value\n" 54 | "\t %%T - counts that package delay time(default 40ms)\n" 55 | "\t %%h - Median value\n" 56 | "\t %%S - Standard deviation\n" 57 | "\t %%v - Variance (square stddev)\n" 58 | "\t %%I - Iteration number\n" 59 | "\t %%t - Timestamp since iteration zero\n" 60 | "\t %%T - Unix timestamp\n" 61 | "\t %%%% - A literal %%\n" 62 | "\t Default is:\n" 63 | " \"%s\".\n" 64 | "\t Statistics may contain a percentile between\n" 65 | "\t the percentage sign and the code: %%99n, %%95a.\n" 66 | "\t--header[=
], --no-header\n" 67 | "\t Whether to output a header. If not supplied, a\n" 68 | "\t header is created out of the format. By default,\n" 69 | "\t the header is shown.\n" 70 | "\t--interval , -t\n" 71 | "\t Output interval. Default is %d.\n" 72 | 73 | "\t--iterations , -n\n" 74 | "\t Output iterations. Default is %d, 0 is infinity\n" 75 | "\n" 76 | "\t--help Shows program information and usage.\n" 77 | "\t--version Shows version information.\n" 78 | "\n" 79 | ; 80 | 81 | int 82 | dump_usage(FILE *stream) { 83 | fprintf(stream, usage_msg, program_name, program_name, 84 | DEFAULT_OUTPUT_FORMAT, DEFAULT_OUTPUT_INTERVAL, DEFAULT_OUTPUT_ITERATIONS); 85 | 86 | return 0; 87 | 88 | } 89 | 90 | int 91 | dump_help(FILE *stream) { 92 | dump_version(stream); 93 | dump_usage(stream); 94 | 95 | return 0; 96 | 97 | } 98 | 99 | int 100 | dump_version(FILE *stream) { 101 | fprintf(stream, "%s %s, %s.\n", PACKAGE_NAME, PACKAGE_VERSION, 102 | pcap_lib_version()); 103 | 104 | return 0; 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/functions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #if !defined(FUNCTIONS_H) 23 | #define FUNCTIONS_H 24 | 25 | #include 26 | 27 | int dump_usage(FILE *stream); 28 | int dump_help(FILE *stream); 29 | int dump_version(FILE *stream); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/local-addresses.c: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | struct address_list { 31 | struct in_addr in_addr; 32 | struct address_list *next; 33 | 34 | } address_list; 35 | 36 | int 37 | get_addresses(void) { 38 | pcap_if_t *devlist, *curr; 39 | pcap_addr_t *addr; 40 | char errbuf[PCAP_ERRBUF_SIZE]; 41 | struct address_list *address_list_curr; 42 | 43 | if (pcap_findalldevs(&devlist, errbuf)) { 44 | fprintf(stderr, "pcap: %s\n", errbuf); 45 | return 1; 46 | } 47 | 48 | address_list_curr = &address_list; 49 | 50 | for (curr = devlist; curr; curr = curr->next) { 51 | if (curr->flags & PCAP_IF_LOOPBACK) 52 | continue; 53 | 54 | for (addr = curr->addresses; addr; addr = addr->next) { 55 | struct sockaddr *realaddr; 56 | 57 | if (addr->addr) 58 | realaddr = addr->addr; 59 | else if (addr->dstaddr) 60 | realaddr = addr->dstaddr; 61 | else 62 | continue; 63 | 64 | if (realaddr->sa_family == AF_INET || 65 | realaddr->sa_family == AF_INET6) 66 | { 67 | struct sockaddr_in *sin; 68 | 69 | sin = (struct sockaddr_in *) realaddr; 70 | 71 | address_list_curr->next = malloc(sizeof(struct address_list)); 72 | if (!address_list_curr->next) 73 | abort(); 74 | 75 | address_list_curr->next->in_addr = sin->sin_addr; 76 | address_list_curr->next->next = NULL; 77 | address_list_curr = address_list_curr->next; 78 | 79 | } 80 | 81 | } 82 | 83 | } 84 | 85 | pcap_freealldevs(devlist); 86 | 87 | return 0; 88 | 89 | } 90 | 91 | int 92 | parse_addresses(char addresses[]) { 93 | char *next, *comma; 94 | struct address_list *address_list_curr; 95 | 96 | next = addresses; 97 | address_list_curr = &address_list; 98 | 99 | while ((comma = strchr(next, ','))) { 100 | char *current; 101 | 102 | current = malloc((comma - next) + 1); 103 | if (!current) 104 | abort(); 105 | 106 | strncpy(current, next, (comma - next)); 107 | current[comma - next] = '\0'; 108 | 109 | address_list_curr->next = malloc(sizeof(struct address_list)); 110 | if (!address_list_curr->next) 111 | abort(); 112 | 113 | address_list_curr->next->next = NULL; 114 | 115 | if (!inet_aton(current, &address_list_curr->next->in_addr)) { 116 | free(current); 117 | return 1; 118 | 119 | } 120 | 121 | address_list_curr = address_list_curr->next; 122 | 123 | free(current); 124 | 125 | next = comma + 1; 126 | 127 | } 128 | 129 | address_list_curr->next = malloc(sizeof(struct address_list)); 130 | if (!address_list_curr->next) 131 | abort(); 132 | 133 | address_list_curr->next->next = NULL; 134 | 135 | if (!inet_aton(next, &address_list_curr->next->in_addr)) 136 | return 1; 137 | 138 | address_list_curr = address_list_curr->next; 139 | 140 | return 0; 141 | 142 | } 143 | 144 | int 145 | free_addresses(void) { 146 | struct address_list *next; 147 | 148 | while (address_list.next) { 149 | next = address_list.next->next; 150 | free(address_list.next); 151 | address_list.next = next; 152 | 153 | } 154 | 155 | return 0; 156 | 157 | } 158 | 159 | int 160 | is_local_address(struct in_addr addr) { 161 | struct address_list *curr; 162 | 163 | for (curr = address_list.next; curr; curr = curr->next) 164 | if (curr->in_addr.s_addr == addr.s_addr) 165 | return 1; 166 | 167 | return 0; 168 | 169 | } 170 | -------------------------------------------------------------------------------- /src/local-addresses.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #if !defined(LOCAL_ADDRESSES_H) 23 | #define LOCAL_ADDRESSES_H 24 | 25 | #include 26 | 27 | int get_addresses(void); 28 | int parse_addresses(char []); 29 | int free_addresses(void); 30 | 31 | int is_local_address(struct in_addr); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/output.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/output.c -------------------------------------------------------------------------------- /src/output.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/output.h -------------------------------------------------------------------------------- /src/process-packet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/process-packet.c -------------------------------------------------------------------------------- /src/process-packet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #if !defined(PROCESS_PACKET_H) 23 | #define PROCESS_PACKET_H 24 | 25 | #include 26 | #include 27 | 28 | void process_packet(unsigned char *, const struct pcap_pkthdr *, 29 | const unsigned char *); 30 | int process_ip(pcap_t *dev, const struct ip *ip, struct timeval tv); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/stats-hash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/stats-hash.c -------------------------------------------------------------------------------- /src/stats-hash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #if !defined(STATS_HASH_H) 23 | #define STATS_HASH_H 24 | 25 | struct hash; 26 | 27 | struct hash *hash_new(void); 28 | void hash_del(struct hash *hash); 29 | int hash_get(struct hash *hash, 30 | uint32_t laddr, uint32_t raddr, uint16_t lport, uint16_t rport, 31 | struct timeval *result); 32 | int hash_get_rem(struct hash *hash, 33 | uint32_t laddr, uint32_t raddr, uint16_t lport, uint16_t rport, 34 | struct timeval *result); 35 | int hash_set(struct hash *hash, 36 | uint32_t laddr, uint32_t raddr, uint16_t lport, uint16_t rport, 37 | struct timeval value); 38 | 39 | int hash_clean(struct hash *hash, unsigned long min); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/stats.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/stats.c -------------------------------------------------------------------------------- /src/stats.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tcprstat -- Extract stats about TCP response times 3 | * Copyright (C) 2010 Ignacio Nin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | **/ 21 | 22 | #if !defined(STATS_H) 23 | #define STATS_H 24 | 25 | #include 26 | #include 27 | 28 | struct stats_results; 29 | 30 | int init_stats(void); 31 | int free_stats(void); 32 | 33 | int inbound(struct timeval tv, struct in_addr laddr, struct in_addr raddr, 34 | uint16_t lport, uint16_t rport); 35 | int outbound(struct timeval tv, struct in_addr laddr, struct in_addr raddr, 36 | uint16_t lport, uint16_t rport); 37 | 38 | struct stats_results *get_flush_stats(void); 39 | int free_results(struct stats_results *); 40 | 41 | unsigned stats_count(struct stats_results *r, int percentile); 42 | unsigned long stats_avg(struct stats_results *r, int percentile); 43 | unsigned long stats_sum(struct stats_results *r, int percentile); 44 | unsigned long stats_sqs(struct stats_results *r, int percentile); 45 | unsigned long stats_min(struct stats_results *r, int percentile); 46 | unsigned long stats_max(struct stats_results *r, int percentile); 47 | unsigned long stats_med(struct stats_results *r, int percentile); 48 | unsigned long stats_var(struct stats_results *r, int percentile); 49 | unsigned long stats_std(struct stats_results *r, int percentile); 50 | unsigned long 51 | stats_delay_count(struct stats_results *results, int percentile); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/tcprstat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/tcprstat.c -------------------------------------------------------------------------------- /src/tcprstat.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/tcprstat.h -------------------------------------------------------------------------------- /src/tcprstat_tc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/src/tcprstat_tc -------------------------------------------------------------------------------- /说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/y123456yz/tcprstat/7b6af93f9de025611f77682ed80871a8d8fe6f89/说明.txt --------------------------------------------------------------------------------