Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
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
linux
Commits
2f746ed2
Commit
2f746ed2
authored
Apr 07, 2003
by
Nivedita Singhvi
Committed by
David S. Miller
Apr 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TCP]: Missing SNMP stats.
parent
12332a86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
include/net/tcp.h
include/net/tcp.h
+15
-0
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+2
-0
net/ipv4/proc.c
net/ipv4/proc.c
+9
-3
No files found.
include/net/tcp.h
View file @
2f746ed2
...
...
@@ -31,6 +31,7 @@
#include <linux/percpu.h>
#include <net/checksum.h>
#include <net/sock.h>
#include <net/snmp.h>
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
#include <linux/ipv6.h>
#endif
...
...
@@ -639,6 +640,8 @@ DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics);
#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field)
#define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(tcp_statistics, field)
#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field)
#define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val)
#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val)
extern
__inline__
void
tcp_put_port
(
struct
sock
*
sk
);
extern
void
tcp_inherit_port
(
struct
sock
*
sk
,
struct
sock
*
child
);
...
...
@@ -1398,6 +1401,9 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
break
;
case
TCP_CLOSE
:
if
(
oldstate
==
TCP_CLOSE_WAIT
||
oldstate
==
TCP_ESTABLISHED
)
TCP_INC_STATS
(
TcpEstabResets
);
sk
->
prot
->
unhash
(
sk
);
if
(
sk
->
prev
&&
!
(
sk
->
userlocks
&
SOCK_BINDPORT_LOCK
))
tcp_put_port
(
sk
);
...
...
@@ -1878,4 +1884,13 @@ static inline int tcp_use_frto(const struct sock *sk)
tp
->
snd_una
+
tp
->
snd_wnd
));
}
static
inline
void
tcp_mib_init
(
void
)
{
/* See RFC 2012 */
TCP_ADD_STATS_USER
(
TcpRtoAlgorithm
,
1
);
TCP_ADD_STATS_USER
(
TcpRtoMin
,
TCP_RTO_MIN
*
1000
/
HZ
);
TCP_ADD_STATS_USER
(
TcpRtoMax
,
TCP_RTO_MAX
*
1000
/
HZ
);
TCP_ADD_STATS_USER
(
TcpMaxConn
,
-
1
);
}
#endif
/* _TCP_H */
net/ipv4/af_inet.c
View file @
2f746ed2
...
...
@@ -1108,6 +1108,8 @@ static int __init init_ipv4_mibs(void)
}
}
(
void
)
tcp_mib_init
();
return
0
;
}
...
...
net/ipv4/proc.c
View file @
2f746ed2
...
...
@@ -143,9 +143,15 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
"InSegs OutSegs RetransSegs InErrs OutRsts
\n
Tcp:"
);
for
(
i
=
0
;
i
<
offsetof
(
struct
tcp_mib
,
__pad
)
/
sizeof
(
unsigned
long
);
i
++
)
seq_printf
(
seq
,
" %lu"
,
fold_field
((
void
**
)
tcp_statistics
,
i
));
i
<
offsetof
(
struct
tcp_mib
,
__pad
)
/
sizeof
(
unsigned
long
);
i
++
)
{
if
(
i
==
(
offsetof
(
struct
tcp_mib
,
TcpMaxConn
)
/
sizeof
(
unsigned
long
)))
/* MaxConn field is negative, RFC 2012 */
seq_printf
(
seq
,
" %ld"
,
fold_field
((
void
**
)
tcp_statistics
,
i
));
else
seq_printf
(
seq
,
" %lu"
,
fold_field
((
void
**
)
tcp_statistics
,
i
));
}
seq_printf
(
seq
,
"
\n
Udp: InDatagrams NoPorts InErrors OutDatagrams
\n
"
"Udp:"
);
...
...
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