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
367a499b
Commit
367a499b
authored
May 12, 1998
by
Klaas Freitag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete conversion to proc_get_fmt.
parent
e719ffd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
lib/inet_gr.c
lib/inet_gr.c
+19
-1
No files found.
lib/inet_gr.c
View file @
367a499b
...
@@ -149,6 +149,7 @@ int rprint_fib(int ext, int numeric)
...
@@ -149,6 +149,7 @@ int rprint_fib(int ext, int numeric)
}
}
}
}
free
(
fmt
);
(
void
)
fclose
(
fp
);
(
void
)
fclose
(
fp
);
return
(
0
);
return
(
0
);
}
}
...
@@ -160,6 +161,7 @@ int rprint_cache(int ext, int numeric)
...
@@ -160,6 +161,7 @@ int rprint_cache(int ext, int numeric)
char
mask_addr
[
128
];
char
mask_addr
[
128
];
struct
sockaddr
snet
,
sgate
,
smask
;
struct
sockaddr
snet
,
sgate
,
smask
;
int
num
,
iflags
,
metric
,
refcnt
,
use
,
mss
,
window
,
irtt
,
hh
,
arp
;
int
num
,
iflags
,
metric
,
refcnt
,
use
,
mss
,
window
,
irtt
,
hh
,
arp
;
char
*
fmt
;
FILE
*
fp
=
fopen
(
_PATH_PROCNET_RTCACHE
,
"r"
);
FILE
*
fp
=
fopen
(
_PATH_PROCNET_RTCACHE
,
"r"
);
...
@@ -182,6 +184,21 @@ int rprint_cache(int ext, int numeric)
...
@@ -182,6 +184,21 @@ int rprint_cache(int ext, int numeric)
"Flags Metric Ref Use Iface "
"Flags Metric Ref Use Iface "
"MSS Window irtt HH Arp
\n
"
));
"MSS Window irtt HH Arp
\n
"
));
fmt
=
proc_gen_fmt
(
_PATH_PROCNET_ROUTE
,
fp
,
"Iface"
,
"%16s"
,
"Destination"
,
"%128s"
,
"Gateway"
,
"%128s"
,
"Flags"
,
"%X"
,
"RefCnt"
,
"%d"
,
"Use"
,
"%d"
,
"Metric"
,
"%d"
,
"Mask"
,
"%128s"
,
"MTU"
,
"%d"
,
"Window"
,
"%d"
,
"IRTT"
,
"%d"
,
NULL
);
/* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d\n" */
irtt
=
0
;
irtt
=
0
;
window
=
0
;
window
=
0
;
mss
=
0
;
mss
=
0
;
...
@@ -189,7 +206,7 @@ int rprint_cache(int ext, int numeric)
...
@@ -189,7 +206,7 @@ int rprint_cache(int ext, int numeric)
arp
=
0
;
arp
=
0
;
while
(
fgets
(
buff
,
1023
,
fp
))
while
(
fgets
(
buff
,
1023
,
fp
))
{
{
num
=
sscanf
(
buff
,
"%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d
\n
"
,
num
=
sscanf
(
buff
,
fmt
,
iface
,
net_addr
,
gate_addr
,
iface
,
net_addr
,
gate_addr
,
&
iflags
,
&
refcnt
,
&
use
,
&
metric
,
mask_addr
,
&
iflags
,
&
refcnt
,
&
use
,
&
metric
,
mask_addr
,
&
mss
,
&
window
,
&
irtt
,
&
hh
,
&
arp
);
&
mss
,
&
window
,
&
irtt
,
&
hh
,
&
arp
);
...
@@ -257,6 +274,7 @@ int rprint_cache(int ext, int numeric)
...
@@ -257,6 +274,7 @@ int rprint_cache(int ext, int numeric)
}
}
}
}
free
(
fmt
);
(
void
)
fclose
(
fp
);
(
void
)
fclose
(
fp
);
return
(
0
);
return
(
0
);
}
}
...
...
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