Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
15b431d7
Commit
15b431d7
authored
Jul 03, 2000
by
Andi Kleen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print unknown MIBs.
parent
32b466d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
statistics.c
statistics.c
+24
-16
No files found.
statistics.c
View file @
15b431d7
/*
* Copyright 1997,1999,2000 Andi Kleen. Subject to the GPL.
* $Id: statistics.c,v 1.1
2 2000/06/21 23:48:53
ak Exp $
* $Id: statistics.c,v 1.1
3 2000/07/03 23:39:27
ak Exp $
* 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* 19990101 - added net/netstat, -t, -u, -w supprt - Bernd Eckenfels
...
...
@@ -20,7 +20,7 @@
#define UFWARN(x)
#endif
int
print_static
,
f_raw
,
f_tcp
,
f_udp
;
int
print_static
,
f_raw
,
f_tcp
,
f_udp
,
f_unknown
=
1
;
enum
State
{
number
=
0
,
opt_number
,
i_forward
,
i_inp_icmp
,
i_outp_icmp
,
i_rto_alg
,
...
...
@@ -213,13 +213,14 @@ int cmpentries(const void *a, const void *b)
void
printval
(
struct
tabtab
*
tab
,
char
*
title
,
int
val
)
{
struct
entry
*
ent
,
key
;
struct
entry
*
ent
=
NULL
,
key
;
int
type
;
char
buf
[
512
];
key
.
title
=
title
;
ent
=
bsearch
(
&
key
,
tab
->
tab
,
tab
->
size
/
sizeof
(
struct
entry
),
sizeof
(
struct
entry
),
cmpentries
);
if
(
tab
->
tab
)
ent
=
bsearch
(
&
key
,
tab
->
tab
,
tab
->
size
/
sizeof
(
struct
entry
),
sizeof
(
struct
entry
),
cmpentries
);
if
(
!
ent
)
{
/* try our best */
printf
(
"%*s%s: %d
\n
"
,
states
[
state
].
indent
,
""
,
title
,
val
);
return
;
...
...
@@ -270,18 +271,24 @@ void printval(struct tabtab *tab, char *title, int val)
struct
tabtab
*
newtable
(
struct
tabtab
*
tabs
,
char
*
title
)
{
struct
tabtab
*
t
;
for
(
t
=
tabs
;
t
->
title
;
t
++
)
if
(
!
strcmp
(
title
,
t
->
title
))
{
if
(
*
(
t
->
flag
))
printf
(
"%s:
\n
"
,
_
(
title
));
state
=
normal
;
return
t
;
static
struct
tabtab
dummytab
;
for
(
t
=
tabs
;
t
->
title
;
t
++
)
{
if
(
!
strcmp
(
title
,
t
->
title
))
{
if
(
*
(
t
->
flag
))
printf
(
"%s:
\n
"
,
_
(
title
));
state
=
normal
;
return
t
;
}
}
return
NULL
;
if
(
!
f_unknown
)
return
NULL
;
printf
(
"%s:
\n
"
,
_
(
title
));
dummytab
.
title
=
title
;
dummytab
.
flag
=
&
f_unknown
;
return
&
dummytab
;
}
void
process_fd
(
FILE
*
f
)
{
char
buf1
[
512
],
buf2
[
512
];
...
...
@@ -297,10 +304,11 @@ void process_fd(FILE *f)
if
(
!
np
||
!
sp
)
goto
formaterr
;
*
sp
=
'\0'
;
tab
=
newtable
(
snmptabs
,
buf1
);
if
(
tab
==
NULL
)
{
UFWARN
((
printf
(
_
(
"unknown title %s
\n
"
),
buf1
))
);
continue
;
printf
(
"unknown %s
\n
"
,
buf1
);
continue
;
}
np
++
;
sp
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment