Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/netstat/main.c
| Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | |||||
| int Cflag; /* show congestion control algo and vars */ | int Cflag; /* show congestion control algo and vars */ | ||||
| int dflag; /* show i/f dropped packets */ | int dflag; /* show i/f dropped packets */ | ||||
| int gflag; /* show group (multicast) routing or stats */ | int gflag; /* show group (multicast) routing or stats */ | ||||
| int hflag; /* show counters in human readable format */ | int hflag; /* show counters in human readable format */ | ||||
| int iflag; /* show interfaces */ | int iflag; /* show interfaces */ | ||||
| int Lflag; /* show size of listen queues */ | int Lflag; /* show size of listen queues */ | ||||
| int mflag; /* show memory stats */ | int mflag; /* show memory stats */ | ||||
| int noutputs = 0; /* how much outputs before we exit */ | int noutputs = 0; /* how much outputs before we exit */ | ||||
| int numeric_addr; /* show addresses numerically */ | u_int numeric_addr = 0; /* show addresses numerically */ | ||||
| int numeric_port; /* show ports numerically */ | bool numeric_port; /* show ports numerically */ | ||||
emaste: What do we gain from making it a u_int? it doesn't need to be signed, indeed, but overflow is… | |||||
Done Inline ActionsWhat do we gain from having it signed? Ideally all the flag options up and down should be bools, and only this one should take more than two values. P.S. I can revert it back to original, if that helps the review process. glebius: What do we gain from having it signed? Ideally all the flag options up and down should be bools… | |||||
| int Oflag; /* show nhgrp objects*/ | int Oflag; /* show nhgrp objects*/ | ||||
| int oflag; /* show nexthop objects*/ | int oflag; /* show nexthop objects*/ | ||||
| int Pflag; /* show TCP log ID */ | int Pflag; /* show TCP log ID */ | ||||
| static int pflag; /* show given protocol */ | static int pflag; /* show given protocol */ | ||||
| static int Qflag; /* show netisr information */ | static int Qflag; /* show netisr information */ | ||||
| int rflag; /* show routing tables (or routing stats) */ | int rflag; /* show routing tables (or routing stats) */ | ||||
| int Rflag; /* show flow / RSS statistics */ | int Rflag; /* show flow / RSS statistics */ | ||||
| int sflag; /* show protocol statistics */ | int sflag; /* show protocol statistics */ | ||||
| ▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | case 'M': | ||||
| break; | break; | ||||
| case 'm': | case 'm': | ||||
| mflag = 1; | mflag = 1; | ||||
| break; | break; | ||||
| case 'N': | case 'N': | ||||
| nlistf = optarg; | nlistf = optarg; | ||||
| break; | break; | ||||
| case 'n': | case 'n': | ||||
| numeric_addr = numeric_port = 1; | numeric_addr++; | ||||
| numeric_port = true; | |||||
| break; | break; | ||||
| case 'o': | case 'o': | ||||
| oflag = 1; | oflag = 1; | ||||
| break; | break; | ||||
| case 'O': | case 'O': | ||||
| Oflag = 1; | Oflag = 1; | ||||
| break; | break; | ||||
| case 'P': | case 'P': | ||||
| ▲ Show 20 Lines • Show All 572 Lines • Show Last 20 Lines | |||||
What do we gain from making it a u_int? it doesn't need to be signed, indeed, but overflow is implausible either way.