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,17 +983,21 @@ |
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)); |
39 |
local_addr[sizeof(local_addr)-1] = 0; |
40 |
snprintf(buffer, sizeof(buffer), "%s", |
41 |
get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT)); |
42 |
- |
43 |
- if ((strlen(rem_addr) + strlen(buffer)) >= 27) |
44 |
- rem_addr[27 - strlen(buffer) - 1] = '\0'; |
45 |
+ |
46 |
+ if (!flag_trim) { |
47 |
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27) |
48 |
+ rem_addr[27 - strlen(buffer) - 1] = '\0'; |
49 |
+ } |
50 |
|
51 |
strcat(rem_addr, ":"); |
52 |
strncat(rem_addr, buffer, sizeof(rem_addr)); |
53 |
@@ -1776,6 +1783,7 @@ |
54 |
{"fib", 0, 0, 'F'}, |
55 |
{"groups", 0, 0, 'g'}, |
56 |
{"context", 0, 0, 'Z'}, |
57 |
+ {"notrim", 0, 0, 'T'}, |
58 |
{NULL, 0, 0, 0} |
59 |
}; |
60 |
|
61 |
@@ -1788,7 +1796,7 @@ |
62 |
|
63 |
afname[0] = '\0'; |
64 |
|
65 |
- while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZ", longopts, &lop)) != EOF) |
66 |
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZT", longopts, &lop)) != EOF) |
67 |
switch (i) { |
68 |
case -1: |
69 |
break; |
70 |
@@ -1904,6 +1912,10 @@ |
71 |
usage(); |
72 |
case 's': |
73 |
flag_sta++; |
74 |
+ break; |
75 |
+ case 'T': |
76 |
+ flag_trim++; |
77 |
+ break; |
78 |
} |
79 |
|
80 |
if(argc == optind + 1) { |
81 |
--- net-tools-1.60/netstat.c.trim2 2006-04-06 16:12:02.000000000 +0200 |
82 |
+++ net-tools-1.60/netstat.c 2006-04-06 16:18:09.000000000 +0200 |
83 |
@@ -1737,7 +1737,8 @@ |
84 |
fprintf(stderr, _(" -a, --all, --listening display all sockets (default: connected)\n")); |
85 |
fprintf(stderr, _(" -o, --timers display timers\n")); |
86 |
fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n")); |
87 |
- fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n")); |
88 |
+ fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n")); |
89 |
+ fprintf(stderr, _(" -T, --notrim stop trimming long addresses\n")); |
90 |
fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\n\n")); |
91 |
|
92 |
fprintf(stderr, _(" <Iface>: Name of interface to monitor/list.\n")); |