1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
|
From: Syed Shahrukh Hussain <syed.shahrukh@ossrevival.org>
Date: Wed, 2 Oct 2025 10:00:00 +0500
Subject: [PATCH] Fix old C function declarations.
Forwarded: https://github.com/dleonard0/pktstat/pull/8
diff --git a/abbrev.c b/abbrev.c
index ca331b1..6f81dde 100644
--- a/abbrev.c
+++ b/abbrev.c
@@ -39,8 +39,7 @@ static int abbrev_match(const char *, const char *);
* Return 1 if they match.
*/
static int
-abbrev_match(tag, pattern)
- const char *tag, *pattern;
+abbrev_match(const char *tag, const char * pattern)
{
while (*pattern) {
/* '*' matches zero or more non-space characters */
@@ -81,8 +80,7 @@ abbrev_match(tag, pattern)
* that matches the tag; otherwise return the original tag.
*/
const char *
-abbrev_tag(tag)
- const char *tag;
+abbrev_tag( const char *tag)
{
int i;
@@ -95,8 +93,7 @@ abbrev_tag(tag)
/* Add an abbreviation pattern to the list of known patterns */
void
-abbrev_add(abbrev)
- const char *abbrev;
+abbrev_add(const char *abbrev)
{
char *name, *pattern, *p;
@@ -134,9 +131,7 @@ abbrev_add(abbrev)
/* Load the abbreviations listed in the given file */
void
-abbrev_add_file(filename, ignore_open_error)
- const char *filename;
- int ignore_open_error;
+abbrev_add_file( const char *filename, int ignore_open_error)
{
FILE *f;
char pattern[1024]; /* XXX arbitrary limit? */
diff --git a/display.c b/display.c
index 2ff4c11..2107174 100644
--- a/display.c
+++ b/display.c
@@ -111,9 +111,7 @@ static void printhelp(void);
/* Return SI unit representation for number x, e.g (3000,"%.1f") -> "3.0k" */
static
const char *
-mega(x, fmt)
- double x;
- const char *fmt;
+mega(double x, const char *fmt)
{
static char buf[1024]; /* XXX - arbitrary size */
static char suffix[] = " kMGTPE";
@@ -139,8 +137,7 @@ mega(x, fmt)
/* Return human-friendly time expression, eg in days, weeks, hours etc. */
static const char *
-days(td)
- double td;
+days(double td)
{
static char buf[1024]; /* XXX - arbitrary size */
unsigned long t = td;
@@ -179,8 +176,7 @@ days(td)
/* Prepare the display using curses */
void
-display_open(device, filter)
- const char *device, *filter;
+display_open(const char *device, const char *filter)
{
display_device = device;
@@ -205,8 +201,7 @@ display_close()
}
static void
-update_stats(period)
- double period;
+update_stats(double period)
{
int i;
unsigned long sum;
@@ -278,8 +273,7 @@ batch_update(double period)
/* Update the display, sorting and drawing all the computed tags */
void
-display_update(period)
- double period;
+display_update(double period)
{
int i, flags, ch;
int maxx, maxy, y, x;
diff --git a/ether.c b/ether.c
index 1f464b0..d9a1915 100644
--- a/ether.c
+++ b/ether.c
@@ -59,9 +59,7 @@ struct pppoe_header {
/* Return the tag for an Ethernet II frame */
const char *
-ether_tag(p, end)
- const char *p;
- const char *end;
+ether_tag(const char *p, const char *end)
{
struct ether_header eh;
u_int16_t type;
@@ -98,10 +96,8 @@ ether_tag(p, end)
/* Return the tag for an ethernet-like frame, or NULL if unknown */
const char *
-ether_tagx(type, p, end)
- unsigned int type; /* should be u_int16_t */
- const char *p;
- const char *end;
+ether_tagx(unsigned int type, /* should be u_int16_t */
+ const char *p, const char *end)
{
/*
* From IEEE Std 802.3 2000 edition:
@@ -201,8 +197,7 @@ static struct {
/* 802.2 LLC header */
static const char *
-llc_tag(p, end)
- const char *p, *end;
+llc_tag(const char *p, const char *end)
{
/* ANSI/IEEE Std 802.2 section 3.2 LLC PDU format */
struct llc {
@@ -311,8 +306,7 @@ static struct {
/* Return string form of ethernet type */
static const char *
-ethertype(type)
- unsigned type;
+ethertype(unsigned type)
{
int i;
static char unknown[32];
@@ -326,8 +320,7 @@ ethertype(type)
/* 802.2 SNAP */
static const char *
-snap_tag(p, end)
- const char *p, *end;
+snap_tag(const char *p, const char *end)
{
u_int8_t *snap_oui; /* [3] */
u_int8_t *snap_type; /* [2] */
diff --git a/flow.c b/flow.c
index 2c07aea..2c25e77 100644
--- a/flow.c
+++ b/flow.c
@@ -41,8 +41,7 @@ static int maxflows = 0;
/* Generate a hash value for a tag */
static unsigned int
-hash(tag)
- const char *tag;
+hash(const char *tag)
{
unsigned int result;
@@ -55,8 +54,7 @@ hash(tag)
/* Find a flow by its tag */
struct flow *
-findflow(tag)
- const char *tag;
+findflow(const char *tag)
{
int i;
unsigned int taghash = hash(tag);
@@ -98,9 +96,7 @@ findflow(tag)
/* Compare flows by the number of octets they have carried (reverse order) */
int
-octetcmp(a, b)
- const void *a;
- const void *b;
+octetcmp(const void *a, const void *b)
{
const struct flow *fa = (const struct flow *)a;
const struct flow *fb = (const struct flow *)b;
@@ -109,9 +105,7 @@ octetcmp(a, b)
/* Compare flows by their tag */
int
-tagcmp(a, b)
- const void *a;
- const void *b;
+tagcmp( const void *a, const void *b)
{
const struct flow *fa = (const struct flow *)a;
const struct flow *fb = (const struct flow *)b;
@@ -120,9 +114,7 @@ tagcmp(a, b)
/* Compare flows by the time they were last seen (reverse order) */
int
-lastcmp(a, b)
- const void *a;
- const void *b;
+lastcmp(const void *a, const void *b)
{
const struct flow *fa = (const struct flow *)a;
const struct flow *fb = (const struct flow *)b;
@@ -137,9 +129,7 @@ lastcmp(a, b)
/* Compare flows by their packet count (reverse order) */
int
-packetcmp(a, b)
- const void *a;
- const void *b;
+packetcmp(const void *a, const void *b)
{
const struct flow *fa = (const struct flow *)a;
const struct flow *fb = (const struct flow *)b;
@@ -160,8 +150,7 @@ flow_zero()
/* Remove a flow */
void
-flow_del(f)
- struct flow *f;
+flow_del(struct flow *f)
{
int i = f - flows;
diff --git a/frag.c b/frag.c
index 222349f..6d5a92c 100644
--- a/frag.c
+++ b/frag.c
@@ -75,9 +75,7 @@ static void bucket_delete(struct fragtab *fragtab, struct bucket *bucket);
/* Compute a hash index from a key string */
static unsigned int
-hash(key, keylen)
- const void *key;
- int keylen;
+hash( const void *key, int keylen)
{
unsigned int h = 0;
unsigned char *p;
@@ -89,9 +87,7 @@ hash(key, keylen)
/* Remove a bucket from the lru list */
static void
-bucket_lru_remove(fragtab, bucket)
- struct fragtab *fragtab;
- struct bucket *bucket;
+bucket_lru_remove(struct fragtab *fragtab, struct bucket *bucket)
{
if (bucket->lru_back)
@@ -106,9 +102,7 @@ bucket_lru_remove(fragtab, bucket)
/* Place a (removed) bucket at the front of the lru list */
static void
-bucket_lru_insert(fragtab, bucket)
- struct fragtab *fragtab;
- struct bucket *bucket;
+bucket_lru_insert(struct fragtab *fragtab, struct bucket *bucket)
{
if (fragtab->lru_first) {
bucket->lru_fwd = fragtab->lru_first;
@@ -125,8 +119,7 @@ bucket_lru_insert(fragtab, bucket)
/* Unlink and deallocate a fragment */
static void
-frag_delete(frag)
- struct frag *frag;
+frag_delete(struct frag *frag)
{
LIST_REMOVE(frag, ordered);
free(frag);
@@ -137,9 +130,7 @@ frag_delete(frag)
* should be.
*/
static struct frag **
-frag_find(fragp, index)
- struct frag **fragp;
- u_int32_t index;
+frag_find(struct frag **fragp, u_int32_t index)
{
while (*fragp && (*fragp)->index < index)
fragp = &LIST_NEXT(*fragp, ordered);
@@ -151,9 +142,7 @@ frag_find(fragp, index)
* Returns the end of the chain, if not found.
*/
static struct bucket **
-bucket_find(fragtab, key)
- struct fragtab *fragtab;
- const void *key;
+bucket_find(struct fragtab *fragtab, const void *key)
{
struct bucket **bucketp;
unsigned int keyhash;
@@ -168,10 +157,7 @@ bucket_find(fragtab, key)
/* Create and insert a new bucket */
static void
-bucket_create(fragtab, key, dest)
- struct fragtab *fragtab;
- const void *key;
- struct bucket **dest;
+bucket_create(struct fragtab *fragtab, const void *key, struct bucket **dest)
{
struct bucket *bucket;
size_t size;
@@ -191,12 +177,8 @@ bucket_create(fragtab, key, dest)
/* Create and insert a new fragment. */
static void
-frag_create(fragtab, data, datalen, index, next_index, dest)
- struct fragtab *fragtab;
- const void *data;
- size_t datalen;
- u_int32_t index, next_index;
- struct frag **dest;
+frag_create(struct fragtab *fragtab, const void *data, size_t datalen,
+ u_int32_t index, u_int32_t next_index, struct frag **dest)
{
size_t size;
struct frag* frag;
@@ -215,9 +197,7 @@ frag_create(fragtab, data, datalen, index, next_index, dest)
/* Delete a bucket and all the fragments it contains */
static void
-bucket_delete(fragtab, bucket)
- struct fragtab *fragtab;
- struct bucket *bucket;
+bucket_delete(struct fragtab *fragtab, struct bucket *bucket)
{
while (bucket->first_frag)
frag_delete(bucket->first_frag);
@@ -232,8 +212,7 @@ bucket_delete(fragtab, bucket)
* Allocate an empty fragment table
*/
struct fragtab *
-fragtab_new(keylen, maxbuckets)
- int keylen, maxbuckets;
+fragtab_new(int keylen, int maxbuckets)
{
struct fragtab *fragtab;
int i;
@@ -256,12 +235,8 @@ fragtab_new(keylen, maxbuckets)
* to the young end of the lru list.
*/
void
-fragtab_put(fragtab, key, data, datalen, index, next_index)
- struct fragtab *fragtab;
- const void *key;
- const void *data;
- size_t datalen;
- u_int32_t index, next_index;
+fragtab_put(struct fragtab *fragtab, const void *key, const void *data, size_t datalen,
+ u_int32_t index, u_int32_t next_index)
{
struct bucket **bucketp, *bucket;
struct frag **fragp;
@@ -289,11 +264,7 @@ fragtab_put(fragtab, key, data, datalen, index, next_index)
* or return NULL if it doesn't exist yet.
*/
const void *
-fragtab_get(fragtab, key, index, datalenp)
- struct fragtab *fragtab;
- const void *key;
- u_int32_t index;
- size_t *datalenp;
+fragtab_get(struct fragtab *fragtab, const void *key, u_int32_t index, size_t *datalenp)
{
struct bucket *bucket;
struct frag *frag;
@@ -313,9 +284,7 @@ fragtab_get(fragtab, key, index, datalenp)
* Delete all fragments with the given key
*/
void
-fragtab_del(fragtab, key)
- struct fragtab *fragtab;
- const void *key;
+fragtab_del(struct fragtab *fragtab, const void *key)
{
struct bucket *bucket;
@@ -329,10 +298,8 @@ fragtab_del(fragtab, key)
* ie each fragment's next_index is equal to the next fragment's index
*/
int
-fragtab_check(fragtab, key, first_index, last_index)
- struct fragtab *fragtab;
- const void *key;
- u_int32_t first_index, last_index;
+fragtab_check(struct fragtab *fragtab, const void *key,
+ u_int32_t first_index, u_int32_t last_index)
{
struct bucket *bucket;
struct frag *frag;
@@ -360,8 +327,7 @@ fragtab_check(fragtab, key, first_index, last_index)
* Destroy all storage associated with the fragment table
*/
void
-fragtab_free(fragtab)
- struct fragtab *fragtab;
+fragtab_free(struct fragtab *fragtab)
{
int i;
diff --git a/hash.c b/hash.c
index 4c70ae8..30eceda 100644
--- a/hash.c
+++ b/hash.c
@@ -25,9 +25,7 @@ struct hashelt {
};
static struct hashelt **
-find(h, key)
- struct hash *h;
- const void *key;
+find(struct hash *h, const void *key)
{
unsigned int hash = (*h->hashfn)(key);
struct hashelt **he;
@@ -40,9 +38,7 @@ find(h, key)
/* Find the data associated with a key. Returns 0 if not found. */
const void *
-hash_lookup(h, key)
- struct hash *h;
- const void *key;
+hash_lookup(struct hash *h, const void *key)
{
struct hashelt **he = find(h, key);
@@ -59,10 +55,7 @@ hash_lookup(h, key)
* pointers.
*/
void
-hash_store(h, key, data)
- struct hash *h;
- const void *key;
- const void *data;
+hash_store(struct hash *h, const void *key, const void *data)
{
struct hashelt **he = find(h, key);
struct hashelt *e;
@@ -86,9 +79,7 @@ hash_store(h, key, data)
/* Free a hashed value */
void
-hash_del(h, key)
- struct hash *h;
- const void *key;
+hash_del(struct hash *h, const void *key)
{
struct hashelt **he = find(h, key);
@@ -105,8 +96,7 @@ hash_del(h, key)
/* Free all the values stored in a hash table */
void
-hash_clear(h)
- struct hash *h;
+hash_clear(struct hash *h)
{
int i;
@@ -124,9 +114,7 @@ hash_clear(h)
/* A generic hashing function for binary data */
unsigned int
-hash_generic(data, sz)
- const void *data;
- size_t sz;
+hash_generic( const void *data, size_t sz)
{
unsigned int hash = 0;
const unsigned char *p = (const unsigned char *)data;
diff --git a/icmp.c b/icmp.c
index 9c4beba..f21dc81 100644
--- a/icmp.c
+++ b/icmp.c
@@ -60,10 +60,7 @@ static char *typetab[] = {
#define lengthof(a) (sizeof (a) / sizeof (a)[0])
const char *
-icmp_tag(p, end, ip)
- const char *p;
- const char *end;
- const struct ip *ip;
+icmp_tag( const char *p, const char *end, const struct ip *ip)
{
const char *src, *dst;
static char tag[TAGLEN];
diff --git a/ifc.c b/ifc.c
index 500a82b..1c09687 100644
--- a/ifc.c
+++ b/ifc.c
@@ -42,8 +42,7 @@ static char ifname[IFNAMSIZ];
/* Specify the interface name for future ifc_flags calls */
void
-ifc_init(interface)
- const char *interface;
+ifc_init(const char *interface)
{
/* Allocate a raw socket for later kernel queries on ifc state */
#if defined(AF_PACKET)
diff --git a/ip.c b/ip.c
index b52a29a..7e3229f 100644
--- a/ip.c
+++ b/ip.c
@@ -51,9 +51,7 @@ static const char *ip_fragment(const char *p, const char *end,
static const char *ip_pkt_tag(const char *p, const char *end);
static int
-inaddr_cmp(a, b)
- const void *a;
- const void *b;
+inaddr_cmp(const void *a, const void *b)
{
const struct in_addr *ia = (const struct in_addr *)a;
const struct in_addr *ib = (const struct in_addr *)b;
@@ -62,8 +60,7 @@ inaddr_cmp(a, b)
}
static unsigned int
-inaddr_hash(a)
- const void *a;
+inaddr_hash(const void *a)
{
const struct in_addr *ia = (const struct in_addr *)a;
@@ -91,8 +88,7 @@ ip_reset()
/* Look up an IP address */
const char *
-ip_lookup(addr)
- const struct in_addr *addr;
+ip_lookup(const struct in_addr *addr)
{
const char *result;
static int old_nflag = -1;
@@ -142,10 +138,8 @@ ip_lookup(addr)
/* Handle a fragment */
static const char *
-ip_fragment(p, end, offset)
- const char *p;
- const char *end;
- unsigned offset;
+ip_fragment(const char *p, const char *end,
+ unsigned offset)
{
const struct ip *ip = (const struct ip *)p;
struct ipfkey {
@@ -195,9 +189,7 @@ if (!ip_fragtab) abort();
}
static const char *
-ip_pkt_tag(p, end)
- const char *p;
- const char *end;
+ip_pkt_tag(const char *p, const char *end)
{
const struct ip *ip = (const struct ip *)p;
const char *pktend;
@@ -241,9 +233,7 @@ ip_pkt_tag(p, end)
}
const char *
-ip_tag(p, end)
- const char *p;
- const char *end;
+ip_tag( const char *p, const char *end)
{
const struct ip *ip = (struct ip *)p;
u_int16_t offset;
diff --git a/ip6.c b/ip6.c
index aa0bdbc..50bb3ed 100644
--- a/ip6.c
+++ b/ip6.c
@@ -48,9 +48,7 @@
/* Compare two IPv6 addresses */
static int
-in6addr_cmp(a, b)
- const void *a;
- const void *b;
+in6addr_cmp(const void *a, const void *b)
{
const struct in6_addr *ia = (const struct in6_addr *)a;
const struct in6_addr *ib = (const struct in6_addr *)b;
@@ -60,8 +58,7 @@ in6addr_cmp(a, b)
/* Compute a hash value of an IPv6 address */
static unsigned int
-in6addr_hash(a)
- const void *a;
+in6addr_hash(const void *a)
{
const struct in6_addr *ia = (const struct in6_addr *)a;
@@ -77,8 +74,7 @@ static struct hash ip6_hash = {
/* Look up an IP address */
const char *
-ip6_lookup(addr)
- const struct in6_addr *addr;
+ip6_lookup(const struct in6_addr *addr)
{
const char *result;
static int old_nflag = -1;
@@ -127,9 +123,7 @@ ip6_lookup(addr)
}
const char *
-ip6_tag(p, end)
- const char *p;
- const char *end;
+ip6_tag(const char *p, const char *end)
{
const struct ip6_hdr *ip6;
static char tag[TAGLEN];
diff --git a/ipx.c b/ipx.c
index 35e9ddb..2073afe 100644
--- a/ipx.c
+++ b/ipx.c
@@ -119,8 +119,7 @@ static struct {
* use Cisco's representation, suffixed by a colon and the decimal port number.
*/
static const char *
-my_ipx_ntoa(addr)
- void *addr;
+my_ipx_ntoa(void *addr)
{
static char buf[] = "00000000.0000.0000.0000:0000";
u_int32_t ipx_net;
@@ -141,8 +140,7 @@ my_ipx_ntoa(addr)
}
const char *
-ipx_tag(p, end)
- const char *p, *end;
+ipx_tag(const char *p, const char *end)
{
#if defined(__linux__)
struct ipxhdr h;
diff --git a/loop.c b/loop.c
index 48131f7..0ec2c3a 100644
--- a/loop.c
+++ b/loop.c
@@ -29,9 +29,8 @@
*/
const char *
-loop_tag(p, end)
- const char *p;
- const char *end;
+loop_tag(const char *p, const char *end)
+
{
u_int32_t af;
static char tag[TAGLEN];
diff --git a/main.c b/main.c
index c19cd73..e6fa9b2 100644
--- a/main.c
+++ b/main.c
@@ -104,10 +104,8 @@ void check_canary(const volatile unsigned char *canary, size_t sz) {
* This is called directly from libpcap.
*/
static void
-upcall_from_pcap(context, hdr, data)
- u_char *context;
- const struct pcap_pkthdr *hdr;
- const u_char *data;
+upcall_from_pcap(u_char *context, const struct pcap_pkthdr *hdr,
+ const u_char *data)
{
const char *tag;
const char *(*fn)(const char *, const char *) =
@@ -143,9 +141,7 @@ pcap_cleanup()
/* main */
int
-main(argc, argv)
- int argc;
- char *argv[];
+main( int argc, char *argv[])
{
int ch;
extern int optind;
diff --git a/memcmp.c b/memcmp.c
index cc15f54..b17d977 100644
--- a/memcmp.c
+++ b/memcmp.c
@@ -6,9 +6,7 @@
#include "compat.h"
int
-memcmp(pa, pb, len)
- void *pa, *pb;
- size_t len;
+memcmp( void *pa, void *pb, size_t len)
{
unsigned char *a = (unsigned char *)pa;
unsigned char *b = (unsigned char *)pb;
diff --git a/ppp.c b/ppp.c
index 2b1d1ae..a06e09f 100644
--- a/ppp.c
+++ b/ppp.c
@@ -57,9 +57,7 @@
/* When the datalink type is DLT_PPP, we decode PPP-level packets */
const char *
-ppp_tag(p, end)
- const char *p;
- const char *end;
+ppp_tag(const char *p, const char *end)
{
static char tag[TAGLEN];
diff --git a/sll.c b/sll.c
index 52cb079..bcaeb4b 100644
--- a/sll.c
+++ b/sll.c
@@ -68,9 +68,7 @@ struct sll_header {
/* Return the tag for a Linux cooked socket packet */
const char *
-sll_tag(p, end)
- const char *p;
- const char *end;
+sll_tag(const char *p, const char *end)
{
struct sll_header *sll = (struct sll_header *)p;
const char *tag;
diff --git a/strlcpy.c b/strlcpy.c
index 7451f11..54adb83 100644
--- a/strlcpy.c
+++ b/strlcpy.c
@@ -12,10 +12,7 @@
#include "compat.h"
size_t
-strlcpy(dst, src, len)
- char *dst;
- const char *src;
- size_t len;
+strlcpy(char *dst, const char *src, size_t len)
{
size_t ret = 0;
diff --git a/tag.c b/tag.c
index 24f44d7..073489c 100644
--- a/tag.c
+++ b/tag.c
@@ -29,9 +29,7 @@
* of combined flows.
*/
const char *
-tag_combine(src, dst)
- const char *src;
- const char *dst;
+tag_combine(const char *src, const char *dst)
{
static char buf[TAGLEN];
static char buf2[TAGLEN];
diff --git a/tcp.c b/tcp.c
index 75a22ca..edcfdd8 100644
--- a/tcp.c
+++ b/tcp.c
@@ -65,9 +65,7 @@ static struct {
} ftp;
static int
-tcp_cmp(a, b)
- const void *a;
- const void *b;
+tcp_cmp(const void *a, const void *b)
{
const u_int16_t*ia = (const u_int16_t*)a;
const u_int16_t*ib = (const u_int16_t*)b;
@@ -76,8 +74,7 @@ tcp_cmp(a, b)
}
static unsigned int
-tcp_hash(a)
- const void *a;
+tcp_hash(const void *a)
{
const u_int16_t*ia = (const u_int16_t*)a;
@@ -99,8 +96,7 @@ tcp_reset()
/* Look up a TCP port's symbolic name */
const char *
-tcp_lookup(port)
- u_int16_t port;
+tcp_lookup(u_int16_t port)
{
const char *result;
static int oldnflag = -1;
@@ -145,11 +141,8 @@ tcp_lookup(port)
}
const char *
-tcp_tag(p, end, ip, ip6)
- const char *p;
- const char *end;
- const struct ip *ip;
- const struct ip6_hdr *ip6;
+tcp_tag(const char *p, const char *end, const struct ip *ip,
+ const struct ip6_hdr *ip6)
{
static char src[TAGLEN], dst[TAGLEN];
static char tag[TAGLEN];
@@ -330,10 +323,7 @@ tcp_tag(p, end, ip, ip6)
* back to the control flow
*/
static void
-link_ftp_port(d, tag, end)
- const char *d;
- const char *tag;
- const char *end;
+link_ftp_port(const char *d, const char *tag, const char *end)
{
union {
struct in_addr addr;
@@ -367,12 +357,9 @@ link_ftp_port(d, tag, end)
/* Same, but for EPRT */
static void
-link_ftp_eport(d, tag, end, defaddr, defaddr6)
- const char *d;
- const char *tag;
- const char *end;
- const struct in_addr *defaddr;
- const struct in6_addr *defaddr6;
+link_ftp_eport(const char *d, const char *tag, const char *end,
+ const struct in_addr *defaddr, const struct in6_addr *defaddr6)
+
{
struct in_addr addr;
unsigned int port;
diff --git a/tcp_http.c b/tcp_http.c
index cdf2508..2715735 100644
--- a/tcp_http.c
+++ b/tcp_http.c
@@ -33,11 +33,7 @@
* following object argument as a description for the flow.
*/
void
-tcp_http(f, data, end, toserver)
- struct flow *f;
- const char *data;
- const char *end;
- int toserver;
+tcp_http(struct flow *f, const char *data, const char *end, int toserver)
{
const char *d;
diff --git a/tcp_smtp.c b/tcp_smtp.c
index 05b52f2..575df82 100644
--- a/tcp_smtp.c
+++ b/tcp_smtp.c
@@ -45,9 +45,7 @@ struct smtp_state {
/* Returns pointer to string after prefix, or NULL if no match */
const char *
-strip_prefix(s, prefix)
- const char *s;
- const char *prefix;
+strip_prefix(const char *s, const char *prefix)
{
while (*prefix)
if (*s++ != *prefix++)
@@ -58,8 +56,7 @@ strip_prefix(s, prefix)
/* Normalize a line by uppercasing the command word(s), and stripping
* and collapsing whitespace */
static void
-normalize_line(line)
- char *line;
+normalize_line(char *line)
{
char *s, *p;
int has_colon;
@@ -116,8 +113,7 @@ normalize_line(line)
*/
static void
-normalize_addr(line)
- char *line;
+normalize_addr(char *line)
{
char *s, *t, *u;
@@ -142,9 +138,7 @@ normalize_addr(line)
}
static void
-smtp_line(f, line)
- struct flow *f;
- const char *line;
+smtp_line(struct flow *f, const char *line)
{
struct smtp_state *state;
const char *s;
@@ -223,11 +217,8 @@ if (log)fclose(log);
* Look for simple SMTP (RFC 2822) commands.
*/
void
-tcp_smtp(f, data, end, toserver)
- struct flow *f;
- const char *data;
- const char *end;
- int toserver;
+tcp_smtp(struct flow *f, const char *data, const char *end,
+ int toserver)
{
const char *d;
struct smtp_state *state;
diff --git a/tcp_x11.c b/tcp_x11.c
index 900da35..c2bb970 100644
--- a/tcp_x11.c
+++ b/tcp_x11.c
@@ -79,10 +79,7 @@ struct x11state {
* description of the activity that's causing the traffic.
*/
void
-tcp_x11(f, data, end)
- struct flow *f;
- const char *data;
- const char *end;
+tcp_x11(struct flow *f, const char *data, const char *end)
{
struct x11state *state;
diff --git a/udp.c b/udp.c
index 7440672..ddba4ca 100644
--- a/udp.c
+++ b/udp.c
@@ -46,9 +46,7 @@
#include "display.h"
static int
-udp_cmp(a, b)
- const void *a;
- const void *b;
+udp_cmp(const void *a, const void *b)
{
const u_int16_t*ia = (const u_int16_t*)a;
const u_int16_t*ib = (const u_int16_t*)b;
@@ -57,8 +55,7 @@ udp_cmp(a, b)
}
static unsigned int
-udp_hash(a)
- const void *a;
+udp_hash(const void *a)
{
const u_int16_t*ia = (const u_int16_t*)a;
@@ -80,8 +77,7 @@ udp_reset()
/* Look up an IP address */
const char *
-udp_lookup(port)
- u_int16_t port;
+udp_lookup(u_int16_t port)
{
const char *result;
static int oldnflag = -1;
@@ -122,11 +118,8 @@ udp_lookup(port)
}
const char *
-udp_tag(p, end, ip, ip6)
- const char *p;
- const char *end;
- const struct ip *ip;
- const struct ip6_hdr *ip6;
+udp_tag(const char *p, const char *end, const struct ip *ip,
+ const struct ip6_hdr *ip6)
{
static char src[TAGLEN], dst[TAGLEN];
static char tag[TAGLEN];
diff --git a/wol.c b/wol.c
index f90d4bf..baf39f4 100644
--- a/wol.c
+++ b/wol.c
@@ -32,10 +32,8 @@
* is at the beginning.
*/
const char *
-ether_wol(p, end, src)
- const char *p;
- const char *end;
- const char *src;
+ether_wol(const char *p, const char *end,
+ const char *src)
{
static const unsigned char
magic[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
|