]>
Commit | Line | Data |
---|---|---|
236898d6 MT |
1 | --- net-tools-1.60/man/en_US/netstat.8.old 2006-02-10 11:18:11.000000000 +0100 |
2 | +++ net-tools-1.60/man/en_US/netstat.8 2006-02-10 11:22:19.000000000 +0100 | |
3 | @@ -176,6 +176,10 @@ | |
4 | Print routing information from the FIB. (This is the default.) | |
5 | .SS "\-C" | |
6 | Print routing information from the route cache. | |
7 | +.SS "\-Z \-\-context" | |
8 | +If SELinux enabled print SELinux context. | |
9 | +.SS "\-T \-\-notrim" | |
10 | +Stop trimming long addresses. | |
11 | .SS delay | |
12 | Netstat will cycle printing through statistics every | |
13 | .B delay | |
14 | --- net-tools-1.60/netstat.c.old 2006-02-10 11:18:12.000000000 +0100 | |
15 | +++ net-tools-1.60/netstat.c 2006-02-10 11:13:50.000000000 +0100 | |
16 | @@ -157,6 +157,9 @@ | |
17 | int flag_arg = 0; | |
18 | int flag_ver = 0; | |
19 | int flag_selinux = 0; | |
20 | +int flag_trim = 0; | |
21 | + | |
22 | + | |
23 | ||
24 | FILE *procinfo; | |
25 | ||
26 | @@ -980,16 +983,20 @@ | |
27 | get_sname(htons(local_port), "tcp", | |
28 | flag_not & FLAG_NUM_PORT)); | |
29 | ||
30 | - if ((strlen(local_addr) + strlen(buffer)) >= 27) | |
31 | - local_addr[27 - strlen(buffer) - 1] = '\0'; | |
32 | + if (!flag_trim) { | |
33 | + if ((strlen(local_addr) + strlen(buffer)) >= 27) | |
34 | + local_addr[27 - strlen(buffer) - 1] = '\0'; | |
35 | + } | |
36 | ||
37 | strcat(local_addr, ":"); | |
38 | strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1); | |
39 | snprintf(buffer, sizeof(buffer), "%s", | |
40 | get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT)); | |
41 | - | |
42 | - if ((strlen(rem_addr) + strlen(buffer)) >= 27) | |
43 | - rem_addr[27 - strlen(buffer) - 1] = '\0'; | |
44 | + | |
45 | + if (!flag_trim) { | |
46 | + if ((strlen(rem_addr) + strlen(buffer)) >= 27) | |
47 | + rem_addr[27 - strlen(buffer) - 1] = '\0'; | |
48 | + } | |
49 | ||
50 | strcat(rem_addr, ":"); | |
51 | strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1); | |
52 | @@ -1776,6 +1783,7 @@ | |
53 | {"fib", 0, 0, 'F'}, | |
54 | {"groups", 0, 0, 'g'}, | |
55 | {"context", 0, 0, 'Z'}, | |
56 | + {"notrim", 0, 0, 'T'}, | |
57 | {NULL, 0, 0, 0} | |
58 | }; | |
59 | ||
60 | @@ -1788,7 +1796,7 @@ | |
61 | ||
62 | afname[0] = '\0'; | |
63 | ||
64 | - while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZ", longopts, &lop)) != EOF) | |
65 | + while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZT", longopts, &lop)) != EOF) | |
66 | switch (i) { | |
67 | case -1: | |
68 | break; | |
69 | @@ -1904,6 +1912,10 @@ | |
70 | usage(); | |
71 | case 's': | |
72 | flag_sta++; | |
73 | + break; | |
74 | + case 'T': | |
75 | + flag_trim++; | |
76 | + break; | |
77 | } | |
78 | ||
79 | if(argc == optind + 1) { | |
80 | --- net-tools-1.60/netstat.c.trim2 2006-04-06 16:12:02.000000000 +0200 | |
81 | +++ net-tools-1.60/netstat.c 2006-04-06 16:18:09.000000000 +0200 | |
82 | @@ -1737,7 +1737,8 @@ | |
83 | fprintf(stderr, _(" -a, --all, --listening display all sockets (default: connected)\n")); | |
84 | fprintf(stderr, _(" -o, --timers display timers\n")); | |
85 | fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n")); | |
86 | - fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n")); | |
87 | + fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n")); | |
88 | + fprintf(stderr, _(" -T, --notrim stop trimming long addresses\n")); | |
89 | fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\n\n")); | |
90 | ||
91 | fprintf(stderr, _(" <Iface>: Name of interface to monitor/list.\n")); |