Commit a4f7c7e7 authored by David S. Miller's avatar David S. Miller

Merge bk://bk.skbuff.net:20608/linux-2.6-snmp-20040708

into nuts.davemloft.net:/disk1/BK/snmp-2.6
parents 1bb0fa18 43de50d2
/*
* Definitions for MIBs
*
* Author: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
*/
#ifndef _LINUX_SNMP_H
#define _LINUX_SNMP_H
/* ipstats mib definitions */
/*
* RFC 1213: MIB-II
* RFC 2011 (updates 1213): SNMPv2-MIB-IP
* RFC 2863: Interfaces Group MIB
* RFC 2465: IPv6 MIB: General Group
* draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
*/
enum
{
IPSTATS_MIB_NUM = 0,
IPSTATS_MIB_INRECEIVES, /* InReceives */
IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
IPSTATS_MIB_INNOROUTES, /* InNoRoutes */
IPSTATS_MIB_INADDRERRORS, /* InAddrErrors */
IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */
IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */
IPSTATS_MIB_INDISCARDS, /* InDiscards */
IPSTATS_MIB_INDELIVERS, /* InDelivers */
IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
IPSTATS_MIB_OUTREQUESTS, /* OutRequests */
IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */
IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */
IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */
IPSTATS_MIB_REASMREQDS, /* ReasmReqds */
IPSTATS_MIB_REASMOKS, /* ReasmOKs */
IPSTATS_MIB_REASMFAILS, /* ReasmFails */
IPSTATS_MIB_FRAGOKS, /* FragOKs */
IPSTATS_MIB_FRAGFAILS, /* FragFails */
IPSTATS_MIB_FRAGCREATES, /* FragCreates */
IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */
IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */
__IPSTATS_MIB_MAX
};
/* icmp mib definitions */
/*
* RFC 1213: MIB-II ICMP Group
* RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
*/
enum
{
ICMP_MIB_NUM = 0,
ICMP_MIB_INMSGS, /* InMsgs */
ICMP_MIB_INERRORS, /* InErrors */
ICMP_MIB_INDESTUNREACHS, /* InDestUnreachs */
ICMP_MIB_INTIMEEXCDS, /* InTimeExcds */
ICMP_MIB_INPARMPROBS, /* InParmProbs */
ICMP_MIB_INSRCQUENCHS, /* InSrcQuenchs */
ICMP_MIB_INREDIRECTS, /* InRedirects */
ICMP_MIB_INECHOS, /* InEchos */
ICMP_MIB_INECHOREPS, /* InEchoReps */
ICMP_MIB_INTIMESTAMPS, /* InTimestamps */
ICMP_MIB_INTIMESTAMPREPS, /* InTimestampReps */
ICMP_MIB_INADDRMASKS, /* InAddrMasks */
ICMP_MIB_INADDRMASKREPS, /* InAddrMaskReps */
ICMP_MIB_OUTMSGS, /* OutMsgs */
ICMP_MIB_OUTERRORS, /* OutErrors */
ICMP_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
ICMP_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
ICMP_MIB_OUTPARMPROBS, /* OutParmProbs */
ICMP_MIB_OUTSRCQUENCHS, /* OutSrcQuenchs */
ICMP_MIB_OUTREDIRECTS, /* OutRedirects */
ICMP_MIB_OUTECHOS, /* OutEchos */
ICMP_MIB_OUTECHOREPS, /* OutEchoReps */
ICMP_MIB_OUTTIMESTAMPS, /* OutTimestamps */
ICMP_MIB_OUTTIMESTAMPREPS, /* OutTimestampReps */
ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
__ICMP_MIB_MAX
};
/* icmp6 mib definitions */
/*
* RFC 2466: ICMPv6-MIB
*/
enum
{
ICMP6_MIB_NUM = 0,
ICMP6_MIB_INMSGS, /* InMsgs */
ICMP6_MIB_INERRORS, /* InErrors */
ICMP6_MIB_INDESTUNREACHS, /* InDestUnreachs */
ICMP6_MIB_INPKTTOOBIGS, /* InPktTooBigs */
ICMP6_MIB_INTIMEEXCDS, /* InTimeExcds */
ICMP6_MIB_INPARMPROBLEMS, /* InParmProblems */
ICMP6_MIB_INECHOS, /* InEchos */
ICMP6_MIB_INECHOREPLIES, /* InEchoReplies */
ICMP6_MIB_INGROUPMEMBQUERIES, /* InGroupMembQueries */
ICMP6_MIB_INGROUPMEMBRESPONSES, /* InGroupMembResponses */
ICMP6_MIB_INGROUPMEMBREDUCTIONS, /* InGroupMembReductions */
ICMP6_MIB_INROUTERSOLICITS, /* InRouterSolicits */
ICMP6_MIB_INROUTERADVERTISEMENTS, /* InRouterAdvertisements */
ICMP6_MIB_INNEIGHBORSOLICITS, /* InNeighborSolicits */
ICMP6_MIB_INNEIGHBORADVERTISEMENTS, /* InNeighborAdvertisements */
ICMP6_MIB_INREDIRECTS, /* InRedirects */
ICMP6_MIB_OUTMSGS, /* OutMsgs */
ICMP6_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
ICMP6_MIB_OUTPKTTOOBIGS, /* OutPktTooBigs */
ICMP6_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
ICMP6_MIB_OUTPARMPROBLEMS, /* OutParmProblems */
ICMP6_MIB_OUTECHOREPLIES, /* OutEchoReplies */
ICMP6_MIB_OUTROUTERSOLICITS, /* OutRouterSolicits */
ICMP6_MIB_OUTNEIGHBORSOLICITS, /* OutNeighborSolicits */
ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS, /* OutNeighborAdvertisements */
ICMP6_MIB_OUTREDIRECTS, /* OutRedirects */
ICMP6_MIB_OUTGROUPMEMBRESPONSES, /* OutGroupMembResponses */
ICMP6_MIB_OUTGROUPMEMBREDUCTIONS, /* OutGroupMembReductions */
__ICMP6_MIB_MAX
};
/* tcp mib definitions */
/*
* RFC 1213: MIB-II TCP group
* RFC 2012 (updates 1213): SNMPv2-MIB-TCP
*/
enum
{
TCP_MIB_NUM = 0,
TCP_MIB_RTOALGORITHM, /* RtoAlgorithm */
TCP_MIB_RTOMIN, /* RtoMin */
TCP_MIB_RTOMAX, /* RtoMax */
TCP_MIB_MAXCONN, /* MaxConn */
TCP_MIB_ACTIVEOPENS, /* ActiveOpens */
TCP_MIB_PASSIVEOPENS, /* PassiveOpens */
TCP_MIB_ATTEMPTFAILS, /* AttemptFails */
TCP_MIB_ESTABRESETS, /* EstabResets */
TCP_MIB_CURRESTAB, /* CurrEstab */
TCP_MIB_INSEGS, /* InSegs */
TCP_MIB_OUTSEGS, /* OutSegs */
TCP_MIB_RETRANSSEGS, /* RetransSegs */
TCP_MIB_INERRS, /* InErrs */
TCP_MIB_OUTRSTS, /* OutRsts */
__TCP_MIB_MAX
};
/* udp mib definitions */
/*
* RFC 1213: MIB-II UDP group
* RFC 2013 (updates 1213): SNMPv2-MIB-UDP
*/
enum
{
UDP_MIB_NUM = 0,
UDP_MIB_INDATAGRAMS, /* InDatagrams */
UDP_MIB_NOPORTS, /* NoPorts */
UDP_MIB_INERRORS, /* InErrors */
UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
__UDP_MIB_MAX
};
/* sctp mib definitions */
/*
* draft-ietf-sigtran-sctp-mib-07.txt
*/
enum
{
SCTP_MIB_NUM = 0,
SCTP_MIB_CURRESTAB, /* CurrEstab */
SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */
SCTP_MIB_PASSIVEESTABS, /* PassiveEstabs */
SCTP_MIB_ABORTEDS, /* Aborteds */
SCTP_MIB_SHUTDOWNS, /* Shutdowns */
SCTP_MIB_OUTOFBLUES, /* OutOfBlues */
SCTP_MIB_CHECKSUMERRORS, /* ChecksumErrors */
SCTP_MIB_OUTCTRLCHUNKS, /* OutCtrlChunks */
SCTP_MIB_OUTORDERCHUNKS, /* OutOrderChunks */
SCTP_MIB_OUTUNORDERCHUNKS, /* OutUnorderChunks */
SCTP_MIB_INCTRLCHUNKS, /* InCtrlChunks */
SCTP_MIB_INORDERCHUNKS, /* InOrderChunks */
SCTP_MIB_INUNORDERCHUNKS, /* InUnorderChunks */
SCTP_MIB_FRAGUSRMSGS, /* FragUsrMsgs */
SCTP_MIB_REASMUSRMSGS, /* ReasmUsrMsgs */
SCTP_MIB_OUTSCTPPACKS, /* OutSCTPPacks */
SCTP_MIB_INSCTPPACKS, /* InSCTPPacks */
SCTP_MIB_RTOALGORITHM, /* RtoAlgorithm */
SCTP_MIB_RTOMIN, /* RtoMin */
SCTP_MIB_RTOMAX, /* RtoMax */
SCTP_MIB_RTOINITIAL, /* RtoInitial */
SCTP_MIB_VALCOOKIELIFE, /* ValCookieLife */
SCTP_MIB_MAXINITRETR, /* MaxInitRetr */
__SCTP_MIB_MAX
};
/* linux mib definitions */
enum
{
LINUX_MIB_NUM = 0,
LINUX_MIB_SYNCOOKIESSENT, /* SyncookiesSent */
LINUX_MIB_SYNCOOKIESRECV, /* SyncookiesRecv */
LINUX_MIB_SYNCOOKIESFAILED, /* SyncookiesFailed */
LINUX_MIB_EMBRYONICRSTS, /* EmbryonicRsts */
LINUX_MIB_PRUNECALLED, /* PruneCalled */
LINUX_MIB_RCVPRUNED, /* RcvPruned */
LINUX_MIB_OFOPRUNED, /* OfoPruned */
LINUX_MIB_OUTOFWINDOWICMPS, /* OutOfWindowIcmps */
LINUX_MIB_LOCKDROPPEDICMPS, /* LockDroppedIcmps */
LINUX_MIB_ARPFILTER, /* ArpFilter */
LINUX_MIB_TIMEWAITED, /* TimeWaited */
LINUX_MIB_TIMEWAITRECYCLED, /* TimeWaitRecycled */
LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */
LINUX_MIB_PAWSPASSIVEREJECTED, /* PAWSPassiveRejected */
LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */
LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */
LINUX_MIB_DELAYEDACKS, /* DelayedACKs */
LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */
LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */
LINUX_MIB_LISTENOVERFLOWS, /* ListenOverflows */
LINUX_MIB_LISTENDROPS, /* ListenDrops */
LINUX_MIB_TCPPREQUEUED, /* TCPPrequeued */
LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, /* TCPDirectCopyFromBacklog */
LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, /* TCPDirectCopyFromPrequeue */
LINUX_MIB_TCPPREQUEUEDROPPED, /* TCPPrequeueDropped */
LINUX_MIB_TCPHPHITS, /* TCPHPHits */
LINUX_MIB_TCPHPHITSTOUSER, /* TCPHPHitsToUser */
LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */
LINUX_MIB_TCPHPACKS, /* TCPHPAcks */
LINUX_MIB_TCPRENORECOVERY, /* TCPRenoRecovery */
LINUX_MIB_TCPSACKRECOVERY, /* TCPSackRecovery */
LINUX_MIB_TCPSACKRENEGING, /* TCPSACKReneging */
LINUX_MIB_TCPFACKREORDER, /* TCPFACKReorder */
LINUX_MIB_TCPSACKREORDER, /* TCPSACKReorder */
LINUX_MIB_TCPRENOREORDER, /* TCPRenoReorder */
LINUX_MIB_TCPTSREORDER, /* TCPTSReorder */
LINUX_MIB_TCPFULLUNDO, /* TCPFullUndo */
LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */
LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */
LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */
LINUX_MIB_TCPLOSS, /* TCPLoss */
LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */
LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */
LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */
LINUX_MIB_TCPLOSSFAILURES, /* TCPLossFailures */
LINUX_MIB_TCPFASTRETRANS, /* TCPFastRetrans */
LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
LINUX_MIB_TCPRCVCOLLAPSED, /* TCPRcvCollapsed */
LINUX_MIB_TCPDSACKOLDSENT, /* TCPDSACKOldSent */
LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */
LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
LINUX_MIB_TCPABORTONTIMEOUT, /* TCPAbortOnTimeout */
LINUX_MIB_TCPABORTONLINGER, /* TCPAbortOnLinger */
LINUX_MIB_TCPABORTFAILED, /* TCPAbortFailed */
LINUX_MIB_TCPMEMORYPRESSURES, /* TCPMemoryPressures */
__LINUX_MIB_MAX
};
#endif /* _LINUX_SNMP_H */
......@@ -37,18 +37,6 @@ DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
#define ICMP_INC_STATS(field) SNMP_INC_STATS(icmp_statistics, field)
#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field)
#define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field)
#define ICMP_INC_STATS_FIELD(offt) \
(*((unsigned long *) ((void *) \
per_cpu_ptr(icmp_statistics[!in_softirq()],\
smp_processor_id()) + offt)))++
#define ICMP_INC_STATS_BH_FIELD(offt) \
(*((unsigned long *) ((void *) \
per_cpu_ptr(icmp_statistics[0], \
smp_processor_id()) + offt)))++
#define ICMP_INC_STATS_USER_FIELD(offt) \
(*((unsigned long *) ((void *) \
per_cpu_ptr(icmp_statistics[1], \
smp_processor_id()) + offt)))++
extern void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info);
extern int icmp_rcv(struct sk_buff *skb);
......
This diff is collapsed.
......@@ -1543,7 +1543,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
sk->sk_backlog_rcv(sk, skb1);
NET_INC_STATS_BH(TCPPrequeueDropped);
NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED);
}
tp->ucopy.memory = 0;
......@@ -1575,12 +1575,12 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
switch (state) {
case TCP_ESTABLISHED:
if (oldstate != TCP_ESTABLISHED)
TCP_INC_STATS(TcpCurrEstab);
TCP_INC_STATS(TCP_MIB_CURRESTAB);
break;
case TCP_CLOSE:
if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
TCP_INC_STATS(TcpEstabResets);
TCP_INC_STATS(TCP_MIB_ESTABRESETS);
sk->sk_prot->unhash(sk);
if (tcp_sk(sk)->bind_hash &&
......@@ -1589,7 +1589,7 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
/* fall through */
default:
if (oldstate==TCP_ESTABLISHED)
TCP_DEC_STATS(TcpCurrEstab);
TCP_DEC_STATS(TCP_MIB_CURRESTAB);
}
/* Change state AFTER socket is unhashed to avoid closed
......@@ -1961,10 +1961,10 @@ static inline int tcp_use_frto(const struct sock *sk)
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);
TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1);
TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ);
TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ);
TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1);
}
/* /proc */
......
......@@ -426,7 +426,7 @@ static int arp_filter(__u32 sip, __u32 tip, struct net_device *dev)
if (ip_route_output_key(&rt, &fl) < 0)
return 1;
if (rt->u.dst.dev != dev) {
NET_INC_STATS_BH(ArpFilter);
NET_INC_STATS_BH(LINUX_MIB_ARPFILTER);
flag = 1;
}
ip_rt_put(rt);
......
......@@ -213,8 +213,8 @@ int sysctl_icmp_ratemask = 0x1818;
*/
struct icmp_control {
int output_off; /* Field offset for increment on output */
int input_off; /* Field offset for increment on input */
int output_entry; /* Field for increment on output */
int input_entry; /* Field for increment on input */
void (*handler)(struct sk_buff *skb);
short error; /* This ICMP is classed as an error message */
};
......@@ -318,8 +318,8 @@ static inline int icmpv4_xrlim_allow(struct rtable *rt, int type, int code)
static void icmp_out_count(int type)
{
if (type <= NR_ICMP_TYPES) {
ICMP_INC_STATS_FIELD(icmp_pointers[type].output_off);
ICMP_INC_STATS(IcmpOutMsgs);
ICMP_INC_STATS(icmp_pointers[type].output_entry);
ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
}
}
......@@ -714,7 +714,7 @@ static void icmp_unreach(struct sk_buff *skb)
out:
return;
out_err:
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
goto out;
}
......@@ -755,7 +755,7 @@ static void icmp_redirect(struct sk_buff *skb)
out:
return;
out_err:
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
goto out;
}
......@@ -823,7 +823,7 @@ static void icmp_timestamp(struct sk_buff *skb)
out:
return;
out_err:
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
goto out;
}
......@@ -922,7 +922,7 @@ int icmp_rcv(struct sk_buff *skb)
struct icmphdr *icmph;
struct rtable *rt = (struct rtable *)skb->dst;
ICMP_INC_STATS_BH(IcmpInMsgs);
ICMP_INC_STATS_BH(ICMP_MIB_INMSGS);
switch (skb->ip_summed) {
case CHECKSUM_HW:
......@@ -974,14 +974,14 @@ int icmp_rcv(struct sk_buff *skb)
}
}
ICMP_INC_STATS_BH_FIELD(icmp_pointers[icmph->type].input_off);
ICMP_INC_STATS_BH(icmp_pointers[icmph->type].input_entry);
icmp_pointers[icmph->type].handler(skb);
drop:
kfree_skb(skb);
return 0;
error:
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
goto drop;
}
......@@ -990,109 +990,109 @@ int icmp_rcv(struct sk_buff *skb)
*/
static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
[ICMP_ECHOREPLY] = {
.output_off = offsetof(struct icmp_mib, IcmpOutEchoReps),
.input_off = offsetof(struct icmp_mib, IcmpInEchoReps),
.output_entry = ICMP_MIB_OUTECHOREPS,
.input_entry = ICMP_MIB_INECHOREPS,
.handler = icmp_discard,
},
[1] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib,IcmpInErrors),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_INERRORS,
.handler = icmp_discard,
.error = 1,
},
[2] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib,IcmpInErrors),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_INERRORS,
.handler = icmp_discard,
.error = 1,
},
[ICMP_DEST_UNREACH] = {
.output_off = offsetof(struct icmp_mib, IcmpOutDestUnreachs),
.input_off = offsetof(struct icmp_mib, IcmpInDestUnreachs),
.output_entry = ICMP_MIB_OUTDESTUNREACHS,
.input_entry = ICMP_MIB_INDESTUNREACHS,
.handler = icmp_unreach,
.error = 1,
},
[ICMP_SOURCE_QUENCH] = {
.output_off = offsetof(struct icmp_mib, IcmpOutSrcQuenchs),
.input_off = offsetof(struct icmp_mib, IcmpInSrcQuenchs),
.output_entry = ICMP_MIB_OUTSRCQUENCHS,
.input_entry = ICMP_MIB_INSRCQUENCHS,
.handler = icmp_unreach,
.error = 1,
},
[ICMP_REDIRECT] = {
.output_off = offsetof(struct icmp_mib, IcmpOutRedirects),
.input_off = offsetof(struct icmp_mib, IcmpInRedirects),
.output_entry = ICMP_MIB_OUTREDIRECTS,
.input_entry = ICMP_MIB_INREDIRECTS,
.handler = icmp_redirect,
.error = 1,
},
[6] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib, IcmpInErrors),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_INERRORS,
.handler = icmp_discard,
.error = 1,
},
[7] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib, IcmpInErrors),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_INERRORS,
.handler = icmp_discard,
.error = 1,
},
[ICMP_ECHO] = {
.output_off = offsetof(struct icmp_mib, IcmpOutEchos),
.input_off = offsetof(struct icmp_mib, IcmpInEchos),
.output_entry = ICMP_MIB_OUTECHOS,
.input_entry = ICMP_MIB_INECHOS,
.handler = icmp_echo,
},
[9] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib, IcmpInErrors),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_INERRORS,
.handler = icmp_discard,
.error = 1,
},
[10] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib, IcmpInErrors),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_INERRORS,
.handler = icmp_discard,
.error = 1,
},
[ICMP_TIME_EXCEEDED] = {
.output_off = offsetof(struct icmp_mib, IcmpOutTimeExcds),
.input_off = offsetof(struct icmp_mib,IcmpInTimeExcds),
.output_entry = ICMP_MIB_OUTTIMEEXCDS,
.input_entry = ICMP_MIB_INTIMEEXCDS,
.handler = icmp_unreach,
.error = 1,
},
[ICMP_PARAMETERPROB] = {
.output_off = offsetof(struct icmp_mib, IcmpOutParmProbs),
.input_off = offsetof(struct icmp_mib, IcmpInParmProbs),
.output_entry = ICMP_MIB_OUTPARMPROBS,
.input_entry = ICMP_MIB_INPARMPROBS,
.handler = icmp_unreach,
.error = 1,
},
[ICMP_TIMESTAMP] = {
.output_off = offsetof(struct icmp_mib, IcmpOutTimestamps),
.input_off = offsetof(struct icmp_mib, IcmpInTimestamps),
.output_entry = ICMP_MIB_OUTTIMESTAMPS,
.input_entry = ICMP_MIB_INTIMESTAMPS,
.handler = icmp_timestamp,
},
[ICMP_TIMESTAMPREPLY] = {
.output_off = offsetof(struct icmp_mib, IcmpOutTimestampReps),
.input_off = offsetof(struct icmp_mib, IcmpInTimestampReps),
.output_entry = ICMP_MIB_OUTTIMESTAMPREPS,
.input_entry = ICMP_MIB_INTIMESTAMPREPS,
.handler = icmp_discard,
},
[ICMP_INFO_REQUEST] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib, dummy),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_DUMMY,
.handler = icmp_discard,
},
[ICMP_INFO_REPLY] = {
.output_off = offsetof(struct icmp_mib, dummy),
.input_off = offsetof(struct icmp_mib, dummy),
.output_entry = ICMP_MIB_DUMMY,
.input_entry = ICMP_MIB_DUMMY,
.handler = icmp_discard,
},
[ICMP_ADDRESS] = {
.output_off = offsetof(struct icmp_mib, IcmpOutAddrMasks),
.input_off = offsetof(struct icmp_mib, IcmpInAddrMasks),
.output_entry = ICMP_MIB_OUTADDRMASKS,
.input_entry = ICMP_MIB_INADDRMASKS,
.handler = icmp_address,
},
[ICMP_ADDRESSREPLY] = {
.output_off = offsetof(struct icmp_mib, IcmpOutAddrMaskReps),
.input_off = offsetof(struct icmp_mib, IcmpInAddrMaskReps),
.output_entry = ICMP_MIB_OUTADDRMASKREPS,
.input_entry = ICMP_MIB_INADDRMASKREPS,
.handler = icmp_address_reply,
},
};
......
......@@ -2217,8 +2217,8 @@ static void igmp_mc_seq_stop(struct seq_file *seq, void *v)
static int igmp_mc_seq_show(struct seq_file *seq, void *v)
{
if (v == SEQ_START_TOKEN)
seq_printf(seq,
"Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n");
seq_puts(seq,
"Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n");
else {
struct ip_mc_list *im = (struct ip_mc_list *)v;
struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
......
......@@ -46,7 +46,7 @@ static inline int ip_forward_finish(struct sk_buff *skb)
{
struct ip_options * opt = &(IPCB(skb)->opt);
IP_INC_STATS_BH(OutForwDatagrams);
IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
if (unlikely(opt->optlen))
ip_forward_options(skb);
......
......@@ -263,7 +263,7 @@ static void ip_evictor(void)
spin_unlock(&qp->lock);
ipq_put(qp);
IP_INC_STATS_BH(ReasmFails);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
}
}
......@@ -281,8 +281,8 @@ static void ip_expire(unsigned long arg)
ipq_kill(qp);
IP_INC_STATS_BH(ReasmTimeout);
IP_INC_STATS_BH(ReasmFails);
IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
if ((qp->last_in&FIRST_IN) && qp->fragments != NULL) {
struct sk_buff *head = qp->fragments;
......@@ -609,7 +609,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
iph = head->nh.iph;
iph->frag_off = 0;
iph->tot_len = htons(len);
IP_INC_STATS_BH(ReasmOKs);
IP_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
qp->fragments = NULL;
return head;
......@@ -625,7 +625,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
"Oversized IP packet from %d.%d.%d.%d.\n",
NIPQUAD(qp->saddr));
out_fail:
IP_INC_STATS_BH(ReasmFails);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
return NULL;
}
......@@ -636,7 +636,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
struct ipq *qp;
struct net_device *dev;
IP_INC_STATS_BH(ReasmReqds);
IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
/* Start by cleaning up the memory. */
if (atomic_read(&ip_frag_mem) > sysctl_ipfrag_high_thresh)
......@@ -661,7 +661,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
return ret;
}
IP_INC_STATS_BH(ReasmFails);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
kfree_skb(skb);
return NULL;
}
......
......@@ -245,16 +245,16 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
protocol = -ret;
goto resubmit;
}
IP_INC_STATS_BH(InDelivers);
IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
} else {
if (!raw_sk) {
if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
IP_INC_STATS_BH(InUnknownProtos);
IP_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS);
icmp_send(skb, ICMP_DEST_UNREACH,
ICMP_PROT_UNREACH, 0);
}
} else
IP_INC_STATS_BH(InDelivers);
IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
kfree_skb(skb);
}
}
......@@ -320,7 +320,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
*/
if (skb_cow(skb, skb_headroom(skb))) {
IP_INC_STATS_BH(InDiscards);
IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
goto drop;
}
iph = skb->nh.iph;
......@@ -349,7 +349,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
return dst_input(skb);
inhdr_error:
IP_INC_STATS_BH(InHdrErrors);
IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
drop:
kfree_skb(skb);
return NET_RX_DROP;
......@@ -368,10 +368,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
if (skb->pkt_type == PACKET_OTHERHOST)
goto drop;
IP_INC_STATS_BH(InReceives);
IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
IP_INC_STATS_BH(InDiscards);
IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
goto out;
}
......@@ -422,7 +422,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
ip_rcv_finish);
inhdr_error:
IP_INC_STATS_BH(InHdrErrors);
IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
drop:
kfree_skb(skb);
out:
......
......@@ -233,7 +233,7 @@ int ip_mc_output(struct sk_buff **pskb)
/*
* If the indicated interface is up and running, send the packet.
*/
IP_INC_STATS(OutRequests);
IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
skb->dev = dev;
skb->protocol = htons(ETH_P_IP);
......@@ -288,7 +288,7 @@ int ip_output(struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
IP_INC_STATS(OutRequests);
IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) &&
!skb_shinfo(skb)->tso_size)
......@@ -393,7 +393,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
dst_output);
no_route:
IP_INC_STATS(OutNoRoutes);
IP_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
kfree_skb(skb);
return -EHOSTUNREACH;
}
......@@ -546,7 +546,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
}
if (err == 0) {
IP_INC_STATS(FragOKs);
IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
return 0;
}
......@@ -555,7 +555,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
kfree_skb(frag);
frag = skb;
}
IP_INC_STATS(FragFails);
IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
return err;
}
......@@ -661,7 +661,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
* Put this fragment into the sending queue.
*/
IP_INC_STATS(FragCreates);
IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
iph->tot_len = htons(len + hlen);
......@@ -672,12 +672,12 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
goto fail;
}
kfree_skb(skb);
IP_INC_STATS(FragOKs);
IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
return err;
fail:
kfree_skb(skb);
IP_INC_STATS(FragFails);
IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
return err;
}
......@@ -963,7 +963,7 @@ int ip_append_data(struct sock *sk,
error:
inet->cork.length -= length;
IP_INC_STATS(OutDiscards);
IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return err;
}
......@@ -1076,7 +1076,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
error:
inet->cork.length -= size;
IP_INC_STATS(OutDiscards);
IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return err;
}
......@@ -1184,7 +1184,7 @@ int ip_push_pending_frames(struct sock *sk)
return err;
error:
IP_INC_STATS(OutDiscards);
IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
goto out;
}
......
......@@ -1114,7 +1114,7 @@ static inline int ipmr_forward_finish(struct sk_buff *skb)
{
struct ip_options * opt = &(IPCB(skb)->opt);
IP_INC_STATS_BH(OutForwDatagrams);
IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
if (unlikely(opt->optlen))
ip_forward_options(skb);
......@@ -1177,7 +1177,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
to blackhole.
*/
IP_INC_STATS_BH(FragFails);
IP_INC_STATS_BH(IPSTATS_MIB_FRAGFAILS);
ip_rt_put(rt);
goto out_free;
}
......
This diff is collapsed.
......@@ -319,7 +319,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length,
err = -EFAULT;
kfree_skb(skb);
error:
IP_INC_STATS(OutDiscards);
IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return err;
}
......
......@@ -59,7 +59,7 @@ __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)
;
*mssp = msstab[mssind] + 1;
NET_INC_STATS_BH(SyncookiesSent);
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESSENT);
return secure_tcp_syn_cookie(skb->nh.iph->saddr, skb->nh.iph->daddr,
skb->h.th->source, skb->h.th->dest,
......@@ -127,11 +127,11 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) ||
(mss = cookie_check(skb, cookie)) == 0) {
NET_INC_STATS_BH(SyncookiesFailed);
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESFAILED);
goto out;
}
NET_INC_STATS_BH(SyncookiesRecv);
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV);
req = tcp_openreq_alloc();
ret = NULL;
......
......@@ -305,7 +305,7 @@ EXPORT_SYMBOL(tcp_memory_pressure);
void tcp_enter_memory_pressure(void)
{
if (!tcp_memory_pressure) {
NET_INC_STATS(TCPMemoryPressures);
NET_INC_STATS(LINUX_MIB_TCPMEMORYPRESSURES);
tcp_memory_pressure = 1;
}
}
......@@ -1109,7 +1109,7 @@ static void tcp_prequeue_process(struct sock *sk)
struct sk_buff *skb;
struct tcp_opt *tp = tcp_sk(sk);
NET_ADD_STATS_USER(TCPPrequeued, skb_queue_len(&tp->ucopy.prequeue));
NET_ADD_STATS_USER(LINUX_MIB_TCPPREQUEUED, skb_queue_len(&tp->ucopy.prequeue));
/* RX process wants to run with disabled BHs, though it is not
* necessary */
......@@ -1392,7 +1392,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
/* __ Restore normal policy in scheduler __ */
if ((chunk = len - tp->ucopy.len) != 0) {
NET_ADD_STATS_USER(TCPDirectCopyFromBacklog, chunk);
NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, chunk);
len -= chunk;
copied += chunk;
}
......@@ -1403,7 +1403,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
tcp_prequeue_process(sk);
if ((chunk = len - tp->ucopy.len) != 0) {
NET_ADD_STATS_USER(TCPDirectCopyFromPrequeue, chunk);
NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
len -= chunk;
copied += chunk;
}
......@@ -1488,7 +1488,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
tcp_prequeue_process(sk);
if (copied > 0 && (chunk = len - tp->ucopy.len) != 0) {
NET_ADD_STATS_USER(TCPDirectCopyFromPrequeue, chunk);
NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
len -= chunk;
copied += chunk;
}
......@@ -1659,13 +1659,13 @@ void tcp_close(struct sock *sk, long timeout)
*/
if (data_was_unread) {
/* Unread data was tossed, zap the connection. */
NET_INC_STATS_USER(TCPAbortOnClose);
NET_INC_STATS_USER(LINUX_MIB_TCPABORTONCLOSE);
tcp_set_state(sk, TCP_CLOSE);
tcp_send_active_reset(sk, GFP_KERNEL);
} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
/* Check zero linger _after_ checking for unread data. */
sk->sk_prot->disconnect(sk, 0);
NET_INC_STATS_USER(TCPAbortOnData);
NET_INC_STATS_USER(LINUX_MIB_TCPABORTONDATA);
} else if (tcp_close_state(sk)) {
/* We FIN if the application ate all the data before
* zapping the connection.
......@@ -1731,7 +1731,7 @@ void tcp_close(struct sock *sk, long timeout)
if (tp->linger2 < 0) {
tcp_set_state(sk, TCP_CLOSE);
tcp_send_active_reset(sk, GFP_ATOMIC);
NET_INC_STATS_BH(TCPAbortOnLinger);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONLINGER);
} else {
int tmo = tcp_fin_time(tp);
......@@ -1754,7 +1754,7 @@ void tcp_close(struct sock *sk, long timeout)
"sockets\n");
tcp_set_state(sk, TCP_CLOSE);
tcp_send_active_reset(sk, GFP_ATOMIC);
NET_INC_STATS_BH(TCPAbortOnMemory);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
}
}
atomic_inc(&tcp_orphan_count);
......
This diff is collapsed.
......@@ -618,11 +618,11 @@ static int __tcp_v4_check_established(struct sock *sk, __u16 lport,
if (twp) {
*twp = tw;
NET_INC_STATS_BH(TimeWaitRecycled);
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
} else if (tw) {
/* Silly. Should hash-dance instead... */
tcp_tw_deschedule(tw);
NET_INC_STATS_BH(TimeWaitRecycled);
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
tcp_tw_put(tw);
}
......@@ -998,14 +998,14 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
int err;
if (skb->len < (iph->ihl << 2) + 8) {
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return;
}
sk = tcp_v4_lookup(iph->daddr, th->dest, iph->saddr,
th->source, tcp_v4_iif(skb));
if (!sk) {
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return;
}
if (sk->sk_state == TCP_TIME_WAIT) {
......@@ -1018,7 +1018,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
* servers this needs to be solved differently.
*/
if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LockDroppedIcmps);
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
if (sk->sk_state == TCP_CLOSE)
goto out;
......@@ -1027,7 +1027,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
seq = ntohl(th->seq);
if (sk->sk_state != TCP_LISTEN &&
!between(seq, tp->snd_una, tp->snd_nxt)) {
NET_INC_STATS(OutOfWindowIcmps);
NET_INC_STATS(LINUX_MIB_OUTOFWINDOWICMPS);
goto out;
}
......@@ -1078,7 +1078,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
BUG_TRAP(!req->sk);
if (seq != req->snt_isn) {
NET_INC_STATS_BH(OutOfWindowIcmps);
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
goto out;
}
......@@ -1096,7 +1096,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
It can f.e. if SYNs crossed.
*/
if (!sock_owned_by_user(sk)) {
TCP_INC_STATS_BH(TcpAttemptFails);
TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
sk->sk_err = err;
sk->sk_error_report(sk);
......@@ -1205,8 +1205,8 @@ static void tcp_v4_send_reset(struct sk_buff *skb)
ip_send_reply(tcp_socket->sk, skb, &arg, sizeof rth);
TCP_INC_STATS_BH(TcpOutSegs);
TCP_INC_STATS_BH(TcpOutRsts);
TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
}
/* The code following below sending ACKs in SYN-RECV and TIME-WAIT states
......@@ -1253,7 +1253,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len);
TCP_INC_STATS_BH(TcpOutSegs);
TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
}
static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb)
......@@ -1290,12 +1290,12 @@ static struct dst_entry* tcp_v4_route_req(struct sock *sk,
.dport = req->rmt_port } } };
if (ip_route_output_flow(&rt, &fl, sk, 0)) {
IP_INC_STATS_BH(OutNoRoutes);
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
return NULL;
}
if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) {
ip_rt_put(rt);
IP_INC_STATS_BH(OutNoRoutes);
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
return NULL;
}
return &rt->u.dst;
......@@ -1505,7 +1505,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (xtime.tv_sec < peer->tcp_ts_stamp + TCP_PAWS_MSL &&
(s32)(peer->tcp_ts - req->ts_recent) >
TCP_PAWS_WINDOW) {
NET_INC_STATS_BH(PAWSPassiveRejected);
NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED);
dst_release(dst);
goto drop_and_free;
}
......@@ -1550,7 +1550,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
drop_and_free:
tcp_openreq_free(req);
drop:
TCP_INC_STATS_BH(TcpAttemptFails);
TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
return 0;
}
......@@ -1605,9 +1605,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
return newsk;
exit_overflow:
NET_INC_STATS_BH(ListenOverflows);
NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
exit:
NET_INC_STATS_BH(ListenDrops);
NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
dst_release(dst);
return NULL;
}
......@@ -1725,7 +1725,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
return 0;
csum_err:
TCP_INC_STATS_BH(TcpInErrs);
TCP_INC_STATS_BH(TCP_MIB_INERRS);
goto discard;
}
......@@ -1743,7 +1743,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
goto discard_it;
/* Count it even if it's bad */
TCP_INC_STATS_BH(TcpInSegs);
TCP_INC_STATS_BH(TCP_MIB_INSEGS);
if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
goto discard_it;
......@@ -1810,7 +1810,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
bad_packet:
TCP_INC_STATS_BH(TcpInErrs);
TCP_INC_STATS_BH(TCP_MIB_INERRS);
} else {
tcp_v4_send_reset(skb);
}
......@@ -1831,7 +1831,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
}
if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
TCP_INC_STATS_BH(TcpInErrs);
TCP_INC_STATS_BH(TCP_MIB_INERRS);
tcp_tw_put((struct tcp_tw_bucket *) sk);
goto discard_it;
}
......
......@@ -266,7 +266,7 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
}
if (paws_reject)
NET_INC_STATS_BH(PAWSEstabRejected);
NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
if(!th->rst) {
/* In this case we must reset the TIMEWAIT timer.
......@@ -462,7 +462,7 @@ static int tcp_do_twkill_work(int slot, unsigned int quota)
}
tcp_tw_count -= killed;
NET_ADD_STATS_BH(TimeWaited, killed);
NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITED, killed);
return ret;
}
......@@ -672,7 +672,7 @@ void tcp_twcal_tick(unsigned long dummy)
out:
if ((tcp_tw_count -= killed) == 0)
del_timer(&tcp_tw_timer);
NET_ADD_STATS_BH(TimeWaitKilled, killed);
NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITKILLED, killed);
spin_unlock(&tw_death_lock);
}
......@@ -845,7 +845,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
newsk->sk_no_largesend = 1;
tcp_vegas_init(newtp);
TCP_INC_STATS_BH(TcpPassiveOpens);
TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS);
}
return newsk;
}
......@@ -976,7 +976,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
if (!(flg & TCP_FLAG_RST))
req->class->send_ack(skb, req);
if (paws_reject)
NET_INC_STATS_BH(PAWSEstabRejected);
NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
return NULL;
}
......@@ -1033,7 +1033,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
}
embryonic_reset:
NET_INC_STATS_BH(EmbryonicRsts);
NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
if (!(flg & TCP_FLAG_RST))
req->class->send_reset(skb);
......
......@@ -291,7 +291,7 @@ int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
if (skb->len != tcp_header_size)
tcp_event_data_sent(tp, skb, sk);
TCP_INC_STATS(TcpOutSegs);
TCP_INC_STATS(TCP_MIB_OUTSEGS);
err = tp->af_specific->queue_xmit(skb, 0);
if (err <= 0)
......@@ -916,7 +916,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
if (err == 0) {
/* Update global TCP statistics. */
TCP_INC_STATS(TcpRetransSegs);
TCP_INC_STATS(TCP_MIB_RETRANSSEGS);
#if FASTRETRANS_DEBUG > 0
if (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS) {
......@@ -968,9 +968,9 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
if (tcp_retransmit_skb(sk, skb))
return;
if (tp->ca_state != TCP_CA_Loss)
NET_INC_STATS_BH(TCPFastRetrans);
NET_INC_STATS_BH(LINUX_MIB_TCPFASTRETRANS);
else
NET_INC_STATS_BH(TCPSlowStartRetrans);
NET_INC_STATS_BH(LINUX_MIB_TCPSLOWSTARTRETRANS);
if (skb ==
skb_peek(&sk->sk_write_queue))
......@@ -1022,7 +1022,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
if (skb == skb_peek(&sk->sk_write_queue))
tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
NET_INC_STATS_BH(TCPForwardRetrans);
NET_INC_STATS_BH(LINUX_MIB_TCPFORWARDRETRANS);
}
}
......@@ -1082,7 +1082,7 @@ void tcp_send_active_reset(struct sock *sk, int priority)
/* NOTE: No TCP options attached and we never retransmit this. */
skb = alloc_skb(MAX_TCP_HEADER, priority);
if (!skb) {
NET_INC_STATS(TCPAbortFailed);
NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
return;
}
......@@ -1097,7 +1097,7 @@ void tcp_send_active_reset(struct sock *sk, int priority)
TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;
TCP_SKB_CB(skb)->when = tcp_time_stamp;
if (tcp_transmit_skb(sk, skb))
NET_INC_STATS(TCPAbortFailed);
NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
}
/* WARNING: This routine must only be called when we have already sent
......@@ -1197,7 +1197,7 @@ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
skb->csum = 0;
th->doff = (tcp_header_size >> 2);
TCP_INC_STATS(TcpOutSegs);
TCP_INC_STATS(TCP_MIB_OUTSEGS);
return skb;
}
......@@ -1285,7 +1285,7 @@ int tcp_connect(struct sock *sk)
sk_charge_skb(sk, buff);
tp->packets_out++;
tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL));
TCP_INC_STATS(TcpActiveOpens);
TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);
/* Timer for repeating the SYN until an answer. */
tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
......
......@@ -83,7 +83,7 @@ static void tcp_write_err(struct sock *sk)
sk->sk_error_report(sk);
tcp_done(sk);
NET_INC_STATS_BH(TCPAbortOnTimeout);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONTIMEOUT);
}
/* Do not allow orphaned sockets to eat all our resources.
......@@ -126,7 +126,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
if (do_reset)
tcp_send_active_reset(sk, GFP_ATOMIC);
tcp_done(sk);
NET_INC_STATS_BH(TCPAbortOnMemory);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
return 1;
}
return 0;
......@@ -212,7 +212,7 @@ static void tcp_delack_timer(unsigned long data)
if (sock_owned_by_user(sk)) {
/* Try again later. */
tp->ack.blocked = 1;
NET_INC_STATS_BH(DelayedACKLocked);
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOCKED);
sk_reset_timer(sk, &tp->delack_timer, jiffies + TCP_DELACK_MIN);
goto out_unlock;
}
......@@ -231,8 +231,8 @@ static void tcp_delack_timer(unsigned long data)
if (skb_queue_len(&tp->ucopy.prequeue)) {
struct sk_buff *skb;
NET_ADD_STATS_BH(TCPSchedulerFailed,
skb_queue_len(&tp->ucopy.prequeue));
NET_ADD_STATS_BH(LINUX_MIB_TCPSCHEDULERFAILED,
skb_queue_len(&tp->ucopy.prequeue));
while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL)
sk->sk_backlog_rcv(sk, skb);
......@@ -252,7 +252,7 @@ static void tcp_delack_timer(unsigned long data)
tp->ack.ato = TCP_ATO_MIN;
}
tcp_send_ack(sk);
NET_INC_STATS_BH(DelayedACKs);
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKS);
}
TCP_CHECK_TIMER(sk);
......@@ -353,19 +353,19 @@ static void tcp_retransmit_timer(struct sock *sk)
if (tp->ca_state == TCP_CA_Disorder || tp->ca_state == TCP_CA_Recovery) {
if (tp->sack_ok) {
if (tp->ca_state == TCP_CA_Recovery)
NET_INC_STATS_BH(TCPSackRecoveryFail);
NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERYFAIL);
else
NET_INC_STATS_BH(TCPSackFailures);
NET_INC_STATS_BH(LINUX_MIB_TCPSACKFAILURES);
} else {
if (tp->ca_state == TCP_CA_Recovery)
NET_INC_STATS_BH(TCPRenoRecoveryFail);
NET_INC_STATS_BH(LINUX_MIB_TCPRENORECOVERYFAIL);
else
NET_INC_STATS_BH(TCPRenoFailures);
NET_INC_STATS_BH(LINUX_MIB_TCPRENOFAILURES);
}
} else if (tp->ca_state == TCP_CA_Loss) {
NET_INC_STATS_BH(TCPLossFailures);
NET_INC_STATS_BH(LINUX_MIB_TCPLOSSFAILURES);
} else {
NET_INC_STATS_BH(TCPTimeouts);
NET_INC_STATS_BH(LINUX_MIB_TCPTIMEOUTS);
}
}
......
......@@ -327,7 +327,7 @@ void udp_err(struct sk_buff *skb, u32 info)
sk = udp_v4_lookup(iph->daddr, uh->dest, iph->saddr, uh->source, skb->dev->ifindex);
if (sk == NULL) {
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return; /* No socket for error */
}
......@@ -654,7 +654,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (free)
kfree(ipc.opt);
if (!err) {
UDP_INC_STATS_USER(UdpOutDatagrams);
UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
return len;
}
return err;
......@@ -836,7 +836,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
return err;
csum_copy_err:
UDP_INC_STATS_BH(UdpInErrors);
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
/* Clear queue. */
if (flags&MSG_PEEK) {
......@@ -1060,7 +1060,7 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
if (ret < 0) {
/* process the ESP packet */
ret = xfrm4_rcv_encap(skb, up->encap_type);
UDP_INC_STATS_BH(UdpInDatagrams);
UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
return -ret;
}
/* FALLTHROUGH -- it's a UDP Packet */
......@@ -1068,7 +1068,7 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
if (sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
if (__udp_checksum_complete(skb)) {
UDP_INC_STATS_BH(UdpInErrors);
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return -1;
}
......@@ -1076,11 +1076,11 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
}
if (sock_queue_rcv_skb(sk,skb)<0) {
UDP_INC_STATS_BH(UdpInErrors);
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return -1;
}
UDP_INC_STATS_BH(UdpInDatagrams);
UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
return 0;
}
......@@ -1208,7 +1208,7 @@ int udp_rcv(struct sk_buff *skb)
if (udp_checksum_complete(skb))
goto csum_error;
UDP_INC_STATS_BH(UdpNoPorts);
UDP_INC_STATS_BH(UDP_MIB_NOPORTS);
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
/*
......@@ -1228,7 +1228,7 @@ int udp_rcv(struct sk_buff *skb)
NIPQUAD(daddr),
ntohs(uh->dest)));
no_header:
UDP_INC_STATS_BH(UdpInErrors);
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return(0);
......@@ -1245,7 +1245,7 @@ int udp_rcv(struct sk_buff *skb)
ntohs(uh->dest),
ulen));
drop:
UDP_INC_STATS_BH(UdpInErrors);
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return(0);
}
......
......@@ -159,7 +159,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
!pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
kfree_skb(skb);
return -1;
}
......@@ -172,7 +172,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return 1;
}
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
return -1;
}
......@@ -227,7 +227,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
!pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
kfree_skb(skb);
return -1;
}
......@@ -236,7 +236,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) ||
skb->pkt_type != PACKET_HOST) {
IP6_INC_STATS_BH(InAddrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
kfree_skb(skb);
return -1;
}
......@@ -252,13 +252,13 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
}
if (hdr->type != IPV6_SRCRT_TYPE_0) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw);
return -1;
}
if (hdr->hdrlen & 0x01) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->hdrlen) - skb->nh.raw);
return -1;
}
......@@ -271,7 +271,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
n = hdr->hdrlen >> 1;
if (hdr->segments_left > n) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->segments_left) - skb->nh.raw);
return -1;
}
......@@ -284,7 +284,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
kfree_skb(skb);
/* the copy is a forwarded packet */
if (skb2 == NULL) {
IP6_INC_STATS_BH(OutDiscards);
IP6_INC_STATS_BH(IPSTATS_MIB_OUTDISCARDS);
return -1;
}
*skbp = skb = skb2;
......@@ -302,7 +302,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
addr += i - 1;
if (ipv6_addr_is_multicast(addr)) {
IP6_INC_STATS_BH(InAddrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
kfree_skb(skb);
return -1;
}
......@@ -319,7 +319,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
}
if (skb->dst->dev->flags&IFF_LOOPBACK) {
if (skb->nh.ipv6h->hop_limit <= 1) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
0, skb->dev);
kfree_skb(skb);
......@@ -436,24 +436,24 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) {
LIMIT_NETDEBUG(
printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]));
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
goto drop;
}
pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2));
if (pkt_len <= IPV6_MAXPLEN) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
return 0;
}
if (skb->nh.ipv6h->payload_len) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff);
return 0;
}
if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {
IP6_INC_STATS_BH(InTruncatedPkts);
IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
goto drop;
}
if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
......
......@@ -174,7 +174,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
*/
dst = ip6_route_output(sk, fl);
if (dst->error) {
IP6_INC_STATS(OutNoRoutes);
IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
} else if (dst->dev && (dst->dev->flags&IFF_LOOPBACK)) {
res = 1;
} else {
......@@ -404,8 +404,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB)
ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6OutDestUnreachs, type - ICMPV6_DEST_UNREACH);
ICMP6_INC_STATS_BH(idev, Icmp6OutMsgs);
ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_OUTDESTUNREACHS, type - ICMPV6_DEST_UNREACH);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
out_put:
if (likely(idev != NULL))
......@@ -480,8 +480,8 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
}
err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, skb->len + sizeof(struct icmp6hdr));
ICMP6_INC_STATS_BH(idev, Icmp6OutEchoReplies);
ICMP6_INC_STATS_BH(idev, Icmp6OutMsgs);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTECHOREPLIES);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
out_put:
if (likely(idev != NULL))
......@@ -560,7 +560,7 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
struct icmp6hdr *hdr;
int type;
ICMP6_INC_STATS_BH(idev, Icmp6InMsgs);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INMSGS);
saddr = &skb->nh.ipv6h->saddr;
daddr = &skb->nh.ipv6h->daddr;
......@@ -593,9 +593,9 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
type = hdr->icmp6_type;
if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB)
ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6InDestUnreachs, type - ICMPV6_DEST_UNREACH);
ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_INDESTUNREACHS, type - ICMPV6_DEST_UNREACH);
else if (type >= ICMPV6_ECHO_REQUEST && type <= NDISC_REDIRECT)
ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6InEchos, type - ICMPV6_ECHO_REQUEST);
ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_INECHOS, type - ICMPV6_ECHO_REQUEST);
switch (type) {
case ICMPV6_ECHO_REQUEST:
......@@ -668,7 +668,7 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
return 0;
discard_it:
ICMP6_INC_STATS_BH(idev, Icmp6InErrors);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
kfree_skb(skb);
return 0;
}
......
......@@ -645,8 +645,8 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl)
static int ip6fl_seq_show(struct seq_file *seq, void *v)
{
if (v == SEQ_START_TOKEN)
seq_printf(seq, "Label S Owner Users Linger Expires "
"Dst Opt\n");
seq_puts(seq, "Label S Owner Users Linger Expires "
"Dst Opt\n");
else
ip6fl_fl_seq_show(seq, v);
return 0;
......
......@@ -64,10 +64,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if (skb->pkt_type == PACKET_OTHERHOST)
goto drop;
IP6_INC_STATS_BH(InReceives);
IP6_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
IP6_INC_STATS_BH(InDiscards);
IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
goto out;
}
......@@ -80,7 +80,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto err;
if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
goto drop;
}
......@@ -97,7 +97,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto truncated;
if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))){
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
goto drop;
}
hdr = skb->nh.ipv6h;
......@@ -109,7 +109,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if (hdr->nexthdr == NEXTHDR_HOP) {
skb->h.raw = (u8*)(hdr+1);
if (ipv6_parse_hopopts(skb, offsetof(struct ipv6hdr, nexthdr)) < 0) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
return 0;
}
hdr = skb->nh.ipv6h;
......@@ -117,9 +117,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
truncated:
IP6_INC_STATS_BH(InTruncatedPkts);
IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
err:
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
drop:
kfree_skb(skb);
out:
......@@ -194,15 +194,15 @@ static inline int ip6_input_finish(struct sk_buff *skb)
if (ret > 0)
goto resubmit;
else if (ret == 0)
IP6_INC_STATS_BH(InDelivers);
IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
} else {
if (!raw_sk) {
if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
IP6_INC_STATS_BH(InUnknownProtos);
IP6_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS);
icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
}
} else {
IP6_INC_STATS_BH(InDelivers);
IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
kfree_skb(skb);
}
}
......@@ -210,7 +210,7 @@ static inline int ip6_input_finish(struct sk_buff *skb)
return 0;
discard:
IP6_INC_STATS_BH(InDiscards);
IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
rcu_read_unlock();
kfree_skb(skb);
return 0;
......@@ -227,7 +227,7 @@ int ip6_mc_input(struct sk_buff *skb)
struct ipv6hdr *hdr;
int deliver;
IP6_INC_STATS_BH(InMcastPkts);
IP6_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS);
hdr = skb->nh.ipv6h;
deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
......
......@@ -87,7 +87,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
} else if (dst->neighbour)
return dst->neighbour->output(skb);
IP6_INC_STATS_BH(OutNoRoutes);
IP6_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
kfree_skb(skb);
return -EINVAL;
......@@ -133,13 +133,13 @@ static int ip6_output2(struct sk_buff **pskb)
ip6_dev_loopback_xmit);
if (skb->nh.ipv6h->hop_limit == 0) {
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
kfree_skb(skb);
return 0;
}
}
IP6_INC_STATS(OutMcastPkts);
IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
}
return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
......@@ -172,7 +172,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
dst = ip6_route_output(skb->sk, &fl);
if (dst->error) {
IP6_INC_STATS(OutNoRoutes);
IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
LIMIT_NETDEBUG(
printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n"));
dst_release(dst);
......@@ -231,7 +231,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
kfree_skb(skb);
skb = skb2;
if (skb == NULL) {
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return -ENOBUFS;
}
if (sk)
......@@ -265,7 +265,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
mtu = dst_pmtu(dst);
if ((skb->len <= mtu) || ipfragok) {
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
}
......@@ -273,7 +273,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
skb->dev = dst->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
IP6_INC_STATS(FragFails);
IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
kfree_skb(skb);
return -EMSGSIZE;
}
......@@ -355,7 +355,7 @@ int ip6_forward(struct sk_buff *skb)
goto error;
if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
IP6_INC_STATS(InDiscards);
IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
goto drop;
}
......@@ -394,7 +394,7 @@ int ip6_forward(struct sk_buff *skb)
}
if (!xfrm6_route_forward(skb)) {
IP6_INC_STATS(InDiscards);
IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
goto drop;
}
......@@ -432,14 +432,14 @@ int ip6_forward(struct sk_buff *skb)
/* Again, force OUTPUT device used as source address */
skb->dev = dst->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_pmtu(dst), skb->dev);
IP6_INC_STATS_BH(InTooBigErrors);
IP6_INC_STATS_BH(FragFails);
IP6_INC_STATS_BH(IPSTATS_MIB_INTOOBIGERRORS);
IP6_INC_STATS_BH(IPSTATS_MIB_FRAGFAILS);
kfree_skb(skb);
return -EMSGSIZE;
}
if (skb_cow(skb, dst->dev->hard_header_len)) {
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
goto drop;
}
......@@ -449,11 +449,11 @@ int ip6_forward(struct sk_buff *skb)
hdr->hop_limit--;
IP6_INC_STATS_BH(OutForwDatagrams);
IP6_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
error:
IP6_INC_STATS_BH(InAddrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
drop:
kfree_skb(skb);
return -EINVAL;
......@@ -566,7 +566,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
tmp_hdr = kmalloc(hlen, GFP_ATOMIC);
if (!tmp_hdr) {
IP6_INC_STATS(FragFails);
IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
return -ENOMEM;
}
......@@ -621,7 +621,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
kfree(tmp_hdr);
if (err == 0) {
IP6_INC_STATS(FragOKs);
IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
return 0;
}
......@@ -631,7 +631,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
frag = skb;
}
IP6_INC_STATS(FragFails);
IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
return err;
}
......@@ -664,7 +664,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) {
NETDEBUG(printk(KERN_INFO "IPv6: frag: no memory for new fragment!\n"));
IP6_INC_STATS(FragFails);
IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
err = -ENOMEM;
goto fail;
}
......@@ -722,19 +722,19 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
* Put this fragment into the sending queue.
*/
IP6_INC_STATS(FragCreates);
IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
err = output(&frag);
if (err)
goto fail;
}
kfree_skb(skb);
IP6_INC_STATS(FragOKs);
IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
return err;
fail:
kfree_skb(skb);
IP6_INC_STATS(FragFails);
IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
return err;
}
......@@ -1019,7 +1019,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
return 0;
error:
inet->cork.length -= length;
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return err;
}
......@@ -1079,7 +1079,7 @@ int ip6_push_pending_frames(struct sock *sk)
ipv6_addr_copy(&hdr->daddr, final_dst);
skb->dst = dst_clone(&rt->u.dst);
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev, dst_output);
if (err) {
if (err > 0)
......@@ -1111,7 +1111,7 @@ void ip6_flush_pending_frames(struct sock *sk)
struct sk_buff *skb;
while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
kfree_skb(skb);
}
......
......@@ -1317,7 +1317,7 @@ static void mld_sendpack(struct sk_buff *skb)
struct inet6_dev *idev = in6_dev_get(skb->dev);
int err;
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h -
sizeof(struct ipv6hdr);
mldlen = skb->tail - skb->h.raw;
......@@ -1328,10 +1328,10 @@ static void mld_sendpack(struct sk_buff *skb)
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev,
dev_queue_xmit);
if (!err) {
ICMP6_INC_STATS(idev,Icmp6OutMsgs);
IP6_INC_STATS(OutMcastPkts);
ICMP6_INC_STATS(idev,ICMP6_MIB_OUTMSGS);
IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
} else
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
if (likely(idev != NULL))
in6_dev_put(idev);
......@@ -1613,7 +1613,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
IPV6_TLV_ROUTERALERT, 2, 0, 0,
IPV6_TLV_PADN, 0 };
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
snd_addr = addr;
if (type == ICMPV6_MGM_REDUCTION) {
snd_addr = &all_routers;
......@@ -1627,7 +1627,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err);
if (skb == NULL) {
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return;
}
......@@ -1668,20 +1668,20 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
dev_queue_xmit);
if (!err) {
if (type == ICMPV6_MGM_REDUCTION)
ICMP6_INC_STATS(idev, Icmp6OutGroupMembReductions);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBREDUCTIONS);
else
ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses);
ICMP6_INC_STATS(idev, Icmp6OutMsgs);
IP6_INC_STATS(OutMcastPkts);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBRESPONSES);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
} else
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
if (likely(idev != NULL))
in6_dev_put(idev);
return;
out:
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
kfree_skb(skb);
}
......
......@@ -452,11 +452,11 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
skb->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutNeighborAdvertisements);
ICMP6_INC_STATS(idev, Icmp6OutMsgs);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
}
if (likely(idev != NULL))
......@@ -536,11 +536,11 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
/* send it! */
skb->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutNeighborSolicits);
ICMP6_INC_STATS(idev, Icmp6OutMsgs);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTNEIGHBORSOLICITS);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
}
if (likely(idev != NULL))
......@@ -609,11 +609,11 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
/* send it! */
skb->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutRouterSolicits);
ICMP6_INC_STATS(idev, Icmp6OutMsgs);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTROUTERSOLICITS);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
}
if (likely(idev != NULL))
......@@ -1335,11 +1335,11 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
buff->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, buff, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutRedirects);
ICMP6_INC_STATS(idev, Icmp6OutMsgs);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTREDIRECTS);
ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
}
if (likely(idev != NULL))
......
......@@ -57,36 +57,34 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
return 0;
}
static struct snmp_item snmp6_ipstats_list[] = {
static struct snmp_mib snmp6_ipstats_list[] = {
/* ipv6 mib according to RFC 2465 */
#define SNMP6_GEN(x) SNMP_ITEM(struct ipstats_mib, x, "Ip6" #x)
SNMP6_GEN(InReceives),
SNMP6_GEN(InHdrErrors),
SNMP6_GEN(InTooBigErrors),
SNMP6_GEN(InNoRoutes),
SNMP6_GEN(InAddrErrors),
SNMP6_GEN(InUnknownProtos),
SNMP6_GEN(InTruncatedPkts),
SNMP6_GEN(InDiscards),
SNMP6_GEN(InDelivers),
SNMP6_GEN(OutForwDatagrams),
SNMP6_GEN(OutRequests),
SNMP6_GEN(OutDiscards),
SNMP6_GEN(OutNoRoutes),
SNMP6_GEN(ReasmTimeout),
SNMP6_GEN(ReasmReqds),
SNMP6_GEN(ReasmOKs),
SNMP6_GEN(ReasmFails),
SNMP6_GEN(FragOKs),
SNMP6_GEN(FragFails),
SNMP6_GEN(FragCreates),
SNMP6_GEN(InMcastPkts),
SNMP6_GEN(OutMcastPkts),
#undef SNMP6_GEN
SNMP_ITEM_SENTINEL
SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INRECEIVES),
SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS),
SNMP_MIB_ITEM("Ip6InTooBigErrors", IPSTATS_MIB_INTOOBIGERRORS),
SNMP_MIB_ITEM("Ip6InNoRoutes", IPSTATS_MIB_INNOROUTES),
SNMP_MIB_ITEM("Ip6InAddrErrors", IPSTATS_MIB_INADDRERRORS),
SNMP_MIB_ITEM("Ip6InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),
SNMP_MIB_ITEM("Ip6InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS),
SNMP_MIB_ITEM("Ip6InDiscards", IPSTATS_MIB_INDISCARDS),
SNMP_MIB_ITEM("Ip6InDelivers", IPSTATS_MIB_INDELIVERS),
SNMP_MIB_ITEM("Ip6OutForwDatagrams", IPSTATS_MIB_OUTFORWDATAGRAMS),
SNMP_MIB_ITEM("Ip6OutRequests", IPSTATS_MIB_OUTREQUESTS),
SNMP_MIB_ITEM("Ip6OutDiscards", IPSTATS_MIB_OUTDISCARDS),
SNMP_MIB_ITEM("Ip6OutNoRoutes", IPSTATS_MIB_OUTNOROUTES),
SNMP_MIB_ITEM("Ip6ReasmTimeout", IPSTATS_MIB_REASMTIMEOUT),
SNMP_MIB_ITEM("Ip6ReasmReqds", IPSTATS_MIB_REASMREQDS),
SNMP_MIB_ITEM("Ip6ReasmOKs", IPSTATS_MIB_REASMOKS),
SNMP_MIB_ITEM("Ip6ReasmFails", IPSTATS_MIB_REASMFAILS),
SNMP_MIB_ITEM("Ip6FragOKs", IPSTATS_MIB_FRAGOKS),
SNMP_MIB_ITEM("Ip6FragFails", IPSTATS_MIB_FRAGFAILS),
SNMP_MIB_ITEM("Ip6FragCreates", IPSTATS_MIB_FRAGCREATES),
SNMP_MIB_ITEM("Ip6InMcastPkts", IPSTATS_MIB_INMCASTPKTS),
SNMP_MIB_ITEM("Ip6OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS),
SNMP_MIB_SENTINEL
};
static struct snmp_item snmp6_icmp6_list[] = {
static struct snmp_mib snmp6_icmp6_list[] = {
/* icmpv6 mib according to RFC 2466
Exceptions: {In|Out}AdminProhibs are removed, because I see
......@@ -97,47 +95,43 @@ static struct snmp_item snmp6_icmp6_list[] = {
OutRouterAdvertisements too.
OutGroupMembQueries too.
*/
#define SNMP6_GEN(x) SNMP_ITEM(struct icmpv6_mib, x, #x)
SNMP6_GEN(Icmp6InMsgs),
SNMP6_GEN(Icmp6InErrors),
SNMP6_GEN(Icmp6InDestUnreachs),
SNMP6_GEN(Icmp6InPktTooBigs),
SNMP6_GEN(Icmp6InTimeExcds),
SNMP6_GEN(Icmp6InParmProblems),
SNMP6_GEN(Icmp6InEchos),
SNMP6_GEN(Icmp6InEchoReplies),
SNMP6_GEN(Icmp6InGroupMembQueries),
SNMP6_GEN(Icmp6InGroupMembResponses),
SNMP6_GEN(Icmp6InGroupMembReductions),
SNMP6_GEN(Icmp6InRouterSolicits),
SNMP6_GEN(Icmp6InRouterAdvertisements),
SNMP6_GEN(Icmp6InNeighborSolicits),
SNMP6_GEN(Icmp6InNeighborAdvertisements),
SNMP6_GEN(Icmp6InRedirects),
SNMP6_GEN(Icmp6OutMsgs),
SNMP6_GEN(Icmp6OutDestUnreachs),
SNMP6_GEN(Icmp6OutPktTooBigs),
SNMP6_GEN(Icmp6OutTimeExcds),
SNMP6_GEN(Icmp6OutParmProblems),
SNMP6_GEN(Icmp6OutEchoReplies),
SNMP6_GEN(Icmp6OutRouterSolicits),
SNMP6_GEN(Icmp6OutNeighborSolicits),
SNMP6_GEN(Icmp6OutNeighborAdvertisements),
SNMP6_GEN(Icmp6OutRedirects),
SNMP6_GEN(Icmp6OutGroupMembResponses),
SNMP6_GEN(Icmp6OutGroupMembReductions),
#undef SNMP6_GEN
SNMP_ITEM_SENTINEL
SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS),
SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS),
SNMP_MIB_ITEM("Icmp6InDestUnreachs", ICMP6_MIB_INDESTUNREACHS),
SNMP_MIB_ITEM("Icmp6InPktTooBigs", ICMP6_MIB_INPKTTOOBIGS),
SNMP_MIB_ITEM("Icmp6InTimeExcds", ICMP6_MIB_INTIMEEXCDS),
SNMP_MIB_ITEM("Icmp6InParmProblems", ICMP6_MIB_INPARMPROBLEMS),
SNMP_MIB_ITEM("Icmp6InEchos", ICMP6_MIB_INECHOS),
SNMP_MIB_ITEM("Icmp6InEchoReplies", ICMP6_MIB_INECHOREPLIES),
SNMP_MIB_ITEM("Icmp6InGroupMembQueries", ICMP6_MIB_INGROUPMEMBQUERIES),
SNMP_MIB_ITEM("Icmp6InGroupMembResponses", ICMP6_MIB_INGROUPMEMBRESPONSES),
SNMP_MIB_ITEM("Icmp6InGroupMembReductions", ICMP6_MIB_INGROUPMEMBREDUCTIONS),
SNMP_MIB_ITEM("Icmp6InRouterSolicits", ICMP6_MIB_INROUTERSOLICITS),
SNMP_MIB_ITEM("Icmp6InRouterAdvertisements", ICMP6_MIB_INROUTERADVERTISEMENTS),
SNMP_MIB_ITEM("Icmp6InNeighborSolicits", ICMP6_MIB_INNEIGHBORSOLICITS),
SNMP_MIB_ITEM("Icmp6InNeighborAdvertisements", ICMP6_MIB_INNEIGHBORADVERTISEMENTS),
SNMP_MIB_ITEM("Icmp6InRedirects", ICMP6_MIB_INREDIRECTS),
SNMP_MIB_ITEM("Icmp6OutMsgs", ICMP6_MIB_OUTMSGS),
SNMP_MIB_ITEM("Icmp6OutDestUnreachs", ICMP6_MIB_OUTDESTUNREACHS),
SNMP_MIB_ITEM("Icmp6OutPktTooBigs", ICMP6_MIB_OUTPKTTOOBIGS),
SNMP_MIB_ITEM("Icmp6OutTimeExcds", ICMP6_MIB_OUTTIMEEXCDS),
SNMP_MIB_ITEM("Icmp6OutParmProblems", ICMP6_MIB_OUTPARMPROBLEMS),
SNMP_MIB_ITEM("Icmp6OutEchoReplies", ICMP6_MIB_OUTECHOREPLIES),
SNMP_MIB_ITEM("Icmp6OutRouterSolicits", ICMP6_MIB_OUTROUTERSOLICITS),
SNMP_MIB_ITEM("Icmp6OutNeighborSolicits", ICMP6_MIB_OUTNEIGHBORSOLICITS),
SNMP_MIB_ITEM("Icmp6OutNeighborAdvertisements", ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS),
SNMP_MIB_ITEM("Icmp6OutRedirects", ICMP6_MIB_OUTREDIRECTS),
SNMP_MIB_ITEM("Icmp6OutGroupMembResponses", ICMP6_MIB_OUTGROUPMEMBRESPONSES),
SNMP_MIB_ITEM("Icmp6OutGroupMembReductions", ICMP6_MIB_OUTGROUPMEMBREDUCTIONS),
SNMP_MIB_SENTINEL
};
static struct snmp_item snmp6_udp6_list[] = {
#define SNMP6_GEN(x) SNMP_ITEM(struct udp_mib, Udp##x, "Udp6" #x)
SNMP6_GEN(InDatagrams),
SNMP6_GEN(NoPorts),
SNMP6_GEN(InErrors),
SNMP6_GEN(OutDatagrams),
#undef SNMP6_GEN
SNMP_ITEM_SENTINEL
static struct snmp_mib snmp6_udp6_list[] = {
SNMP_MIB_ITEM("Udp6InDatagrams", UDP_MIB_INDATAGRAMS),
SNMP_MIB_ITEM("Udp6NoPorts", UDP_MIB_NOPORTS),
SNMP_MIB_ITEM("Udp6InErrors", UDP_MIB_INERRORS),
SNMP_MIB_ITEM("Udp6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
SNMP_MIB_SENTINEL
};
static unsigned long
......@@ -149,23 +143,19 @@ fold_field(void *mib[], int offt)
for (i = 0; i < NR_CPUS; i++) {
if (!cpu_possible(i))
continue;
res +=
*((unsigned long *) (((void *)per_cpu_ptr(mib[0], i)) +
offt));
res +=
*((unsigned long *) (((void *)per_cpu_ptr(mib[1], i)) +
offt));
res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
}
return res;
}
static inline void
snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_item *itemlist)
snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib *itemlist)
{
int i;
for (i=0; itemlist[i].name; i++)
seq_printf(seq, "%-32s\t%lu\n", itemlist[i].name,
fold_field(mib, itemlist[i].offset));
fold_field(mib, itemlist[i].entry));
}
static int snmp6_seq_show(struct seq_file *seq, void *v)
......
......@@ -535,7 +535,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
if (err)
goto error_fault;
IP6_INC_STATS(OutRequests);
IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
dst_output);
if (err > 0)
......@@ -549,7 +549,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
err = -EFAULT;
kfree_skb(skb);
error:
IP6_INC_STATS(OutDiscards);
IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return err;
}
static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
......
......@@ -284,7 +284,7 @@ static void ip6_evictor(void)
spin_unlock(&fq->lock);
fq_put(fq);
IP6_INC_STATS_BH(ReasmFails);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
}
}
......@@ -299,8 +299,8 @@ static void ip6_frag_expire(unsigned long data)
fq_kill(fq);
IP6_INC_STATS_BH(ReasmTimeout);
IP6_INC_STATS_BH(ReasmFails);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
/* Send error only if the first segment arrived. */
if (fq->last_in&FIRST_IN && fq->fragments) {
......@@ -386,7 +386,7 @@ ip6_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr
return ip6_frag_intern(hash, fq);
oom:
IP6_INC_STATS_BH(ReasmFails);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
return NULL;
}
......@@ -426,7 +426,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1)));
if ((unsigned int)end > IPV6_MAXPLEN) {
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb,ICMPV6_HDR_FIELD, (u8*)&fhdr->frag_off - skb->nh.raw);
return;
}
......@@ -453,7 +453,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
/* RFC2460 says always send parameter problem in
* this case. -DaveM
*/
IP6_INC_STATS_BH(InHdrErrors);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
offsetof(struct ipv6hdr, payload_len));
return;
......@@ -572,7 +572,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
return;
err:
IP6_INC_STATS(ReasmFails);
IP6_INC_STATS(IPSTATS_MIB_REASMFAILS);
kfree_skb(skb);
}
......@@ -666,7 +666,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
if (head->ip_summed == CHECKSUM_HW)
head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
IP6_INC_STATS_BH(ReasmOKs);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
fq->fragments = NULL;
*nhoffp = nhoff;
return 1;
......@@ -679,7 +679,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
if (net_ratelimit())
printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
out_fail:
IP6_INC_STATS_BH(ReasmFails);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
return -1;
}
......@@ -693,16 +693,16 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
hdr = skb->nh.ipv6h;
IP6_INC_STATS_BH(ReasmReqds);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
/* Jumbo payload inhibits frag. header */
if (hdr->payload_len==0) {
IP6_INC_STATS(InHdrErrors);
IP6_INC_STATS(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
return -1;
}
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) {
IP6_INC_STATS(InHdrErrors);
IP6_INC_STATS(IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
return -1;
}
......@@ -713,7 +713,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (!(fhdr->frag_off & htons(0xFFF9))) {
/* It is not a fragmented frame */
skb->h.raw += sizeof(struct frag_hdr);
IP6_INC_STATS_BH(ReasmOKs);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
*nhoffp = (u8*)fhdr - skb->nh.raw;
return 1;
......@@ -738,7 +738,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return ret;
}
IP6_INC_STATS_BH(ReasmFails);
IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
kfree_skb(skb);
return -1;
}
......
......@@ -1292,7 +1292,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
int ip6_pkt_discard(struct sk_buff *skb)
{
IP6_INC_STATS(OutNoRoutes);
IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb->dev);
kfree_skb(skb);
return 0;
......
......@@ -55,6 +55,8 @@
#include <net/inet_ecn.h>
#include <net/protocol.h>
#include <net/xfrm.h>
#include <net/addrconf.h>
#include <net/snmp.h>
#include <asm/uaccess.h>
......@@ -495,7 +497,7 @@ static int tcp_v6_check_established(struct sock *sk)
/* Silly. Should hash-dance instead... */
local_bh_disable();
tcp_tw_deschedule(tw);
NET_INC_STATS_BH(TimeWaitRecycled);
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
local_bh_enable();
tcp_tw_put(tw);
......@@ -734,7 +736,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
sk = tcp_v6_lookup(&hdr->daddr, th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
if (sk == NULL) {
ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), Icmp6InErrors);
ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
return;
}
......@@ -745,7 +747,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
bh_lock_sock(sk);
if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LockDroppedIcmps);
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
if (sk->sk_state == TCP_CLOSE)
goto out;
......@@ -754,7 +756,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
seq = ntohl(th->seq);
if (sk->sk_state != TCP_LISTEN &&
!between(seq, tp->snd_una, tp->snd_nxt)) {
NET_INC_STATS_BH(OutOfWindowIcmps);
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
goto out;
}
......@@ -822,7 +824,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
BUG_TRAP(req->sk == NULL);
if (seq != req->snt_isn) {
NET_INC_STATS_BH(OutOfWindowIcmps);
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
goto out;
}
......@@ -833,7 +835,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
case TCP_SYN_RECV: /* Cannot happen.
It can, it SYNs are crossed. --ANK */
if (!sock_owned_by_user(sk)) {
TCP_INC_STATS_BH(TcpAttemptFails);
TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
sk->sk_err = err;
sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */
......@@ -1020,8 +1022,8 @@ static void tcp_v6_send_reset(struct sk_buff *skb)
/* sk = NULL, but it is safe for now. RST socket required. */
if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
ip6_xmit(NULL, buff, &fl, NULL, 0);
TCP_INC_STATS_BH(TcpOutSegs);
TCP_INC_STATS_BH(TcpOutRsts);
TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
return;
}
......@@ -1081,7 +1083,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
ip6_xmit(NULL, buff, &fl, NULL, 0);
TCP_INC_STATS_BH(TcpOutSegs);
TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
return;
}
......@@ -1233,7 +1235,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
if (req)
tcp_openreq_free(req);
TCP_INC_STATS_BH(TcpAttemptFails);
TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
return 0; /* don't send reset */
}
......@@ -1409,9 +1411,9 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
return newsk;
out_overflow:
NET_INC_STATS_BH(ListenOverflows);
NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
out:
NET_INC_STATS_BH(ListenDrops);
NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
if (opt && opt != np->opt)
sock_kfree_s(sk, opt, opt->tot_len);
dst_release(dst);
......@@ -1536,7 +1538,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
kfree_skb(skb);
return 0;
csum_err:
TCP_INC_STATS_BH(TcpInErrs);
TCP_INC_STATS_BH(TCP_MIB_INERRS);
goto discard;
......@@ -1582,7 +1584,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
/*
* Count it even if it's bad.
*/
TCP_INC_STATS_BH(TcpInSegs);
TCP_INC_STATS_BH(TCP_MIB_INSEGS);
if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
goto discard_it;
......@@ -1643,7 +1645,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
bad_packet:
TCP_INC_STATS_BH(TcpInErrs);
TCP_INC_STATS_BH(TCP_MIB_INERRS);
} else {
tcp_v6_send_reset(skb);
}
......@@ -1668,7 +1670,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
}
if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
TCP_INC_STATS_BH(TcpInErrs);
TCP_INC_STATS_BH(TCP_MIB_INERRS);
tcp_tw_put((struct tcp_tw_bucket *) sk);
goto discard_it;
}
......@@ -2015,12 +2017,12 @@ static int tcp6_seq_show(struct seq_file *seq, void *v)
struct tcp_iter_state *st;
if (v == SEQ_START_TOKEN) {
seq_printf(seq,
" sl "
"local_address "
"remote_address "
"st tx_queue rx_queue tr tm->when retrnsmt"
" uid timeout inode\n");
seq_puts(seq,
" sl "
"local_address "
"remote_address "
"st tx_queue rx_queue tr tm->when retrnsmt"
" uid timeout inode\n");
goto out;
}
st = seq->private;
......
......@@ -460,7 +460,7 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
skb_free_datagram(sk, skb);
if (flags & MSG_DONTWAIT) {
UDP6_INC_STATS_USER(UdpInErrors);
UDP6_INC_STATS_USER(UDP_MIB_INERRORS);
return -EAGAIN;
}
goto try_again;
......@@ -509,7 +509,7 @@ static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) {
UDP6_INC_STATS_BH(UdpInErrors);
UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return 0;
}
......@@ -517,11 +517,11 @@ static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
}
if (sock_queue_rcv_skb(sk,skb)<0) {
UDP6_INC_STATS_BH(UdpInErrors);
UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return 0;
}
UDP6_INC_STATS_BH(UdpInDatagrams);
UDP6_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
return 0;
}
......@@ -670,7 +670,7 @@ static int udpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
if (skb->ip_summed != CHECKSUM_UNNECESSARY &&
(unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)))
goto discard;
UDP6_INC_STATS_BH(UdpNoPorts);
UDP6_INC_STATS_BH(UDP_MIB_NOPORTS);
icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev);
......@@ -689,7 +689,7 @@ static int udpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
printk(KERN_DEBUG "UDP: short packet: %d/%u\n", ulen, skb->len);
discard:
UDP6_INC_STATS_BH(UdpInErrors);
UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return(0);
}
......@@ -988,7 +988,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
out:
fl6_sock_release(flowlabel);
if (!err) {
UDP6_INC_STATS_USER(UdpOutDatagrams);
UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
return len;
}
return err;
......
......@@ -879,7 +879,7 @@ static void sctp_assoc_bh_rcv(struct sctp_association *asoc)
if (sctp_chunk_is_data(chunk))
asoc->peer.last_data_from = chunk->transport;
else
SCTP_INC_STATS(SctpInCtrlChunks);
SCTP_INC_STATS(SCTP_MIB_INCTRLCHUNKS);
if (chunk->transport)
chunk->transport->last_time_heard = jiffies;
......
......@@ -215,7 +215,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
offset = 0;
if ((whole > 1) || (whole && over))
SCTP_INC_STATS_USER(SctpFragUsrMsgs);
SCTP_INC_STATS_USER(SCTP_MIB_FRAGUSRMSGS);
/* Create chunks for all the full sized DATA chunks. */
for (i=0, len=first_len; i < whole; i++) {
......
......@@ -369,7 +369,7 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep)
if (asoc && sctp_chunk_is_data(chunk))
asoc->peer.last_data_from = chunk->transport;
else
SCTP_INC_STATS(SctpInCtrlChunks);
SCTP_INC_STATS(SCTP_MIB_INCTRLCHUNKS);
if (chunk->transport)
chunk->transport->last_time_heard = jiffies;
......
......@@ -90,7 +90,7 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb)
if (val != cmp) {
/* CRC failure, dump it. */
SCTP_INC_STATS_BH(SctpChecksumErrors);
SCTP_INC_STATS_BH(SCTP_MIB_CHECKSUMERRORS);
return -1;
}
return 0;
......@@ -117,7 +117,7 @@ int sctp_rcv(struct sk_buff *skb)
if (skb->pkt_type!=PACKET_HOST)
goto discard_it;
SCTP_INC_STATS_BH(SctpInSCTPPacks);
SCTP_INC_STATS_BH(SCTP_MIB_INSCTPPACKS);
sh = (struct sctphdr *) skb->h.raw;
......@@ -166,7 +166,7 @@ int sctp_rcv(struct sk_buff *skb)
if (!asoc) {
ep = __sctp_rcv_lookup_endpoint(&dest);
if (sctp_rcv_ootb(skb)) {
SCTP_INC_STATS_BH(SctpOutOfBlues);
SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES);
goto discard_release;
}
}
......@@ -327,7 +327,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
if (asoc) {
if (ntohl(sctphdr->vtag) != asoc->c.peer_vtag) {
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
goto out;
}
sk = asoc->base.sk;
......@@ -340,7 +340,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
* servers this needs to be solved differently.
*/
if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LockDroppedIcmps);
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
*epp = ep;
*app = asoc;
......@@ -398,7 +398,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
int err;
if (skb->len < ((iph->ihl << 2) + 8)) {
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return;
}
......@@ -412,7 +412,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
skb->nh.raw = saveip;
skb->h.raw = savesctp;
if (!sk) {
ICMP_INC_STATS_BH(IcmpInErrors);
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return;
}
/* Warning: The sock lock is held. Remember to call
......
......@@ -107,7 +107,7 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
skb->nh.raw = saveip;
skb->h.raw = savesctp;
if (!sk) {
ICMP6_INC_STATS_BH(idev, Icmp6InErrors);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
goto out;
}
......@@ -177,7 +177,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
__FUNCTION__, skb, skb->len,
NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
SCTP_INC_STATS(SctpOutSCTPPacks);
SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
return ip6_xmit(sk, skb, &fl, np->opt, ipfragok);
}
......
......@@ -496,7 +496,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
return err;
no_route:
kfree_skb(nskb);
IP_INC_STATS_BH(OutNoRoutes);
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
/* FIXME: Returning the 'err' will effect all the associations
* associated with a socket, although only one of the paths of the
......
......@@ -349,15 +349,15 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
sctp_outq_tail_data(q, chunk);
if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
SCTP_INC_STATS(SctpOutUnorderChunks);
SCTP_INC_STATS(SCTP_MIB_OUTUNORDERCHUNKS);
else
SCTP_INC_STATS(SctpOutOrderChunks);
SCTP_INC_STATS(SCTP_MIB_OUTORDERCHUNKS);
q->empty = 0;
break;
};
} else {
__skb_queue_tail(&q->control, (struct sk_buff *) chunk);
SCTP_INC_STATS(SctpOutCtrlChunks);
SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
}
if (error < 0)
......@@ -1725,6 +1725,6 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
if (ftsn_chunk) {
__skb_queue_tail(&q->control, (struct sk_buff *)ftsn_chunk);
SCTP_INC_STATS(SctpOutCtrlChunks);
SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
}
}
......@@ -39,26 +39,24 @@
#include <linux/init.h>
#include <net/sctp/sctp.h>
static char *sctp_snmp_list[] = {
#define SCTP_SNMP_ENTRY(x) #x
SCTP_SNMP_ENTRY(SctpCurrEstab),
SCTP_SNMP_ENTRY(SctpActiveEstabs),
SCTP_SNMP_ENTRY(SctpPassiveEstabs),
SCTP_SNMP_ENTRY(SctpAborteds),
SCTP_SNMP_ENTRY(SctpShutdowns),
SCTP_SNMP_ENTRY(SctpOutOfBlues),
SCTP_SNMP_ENTRY(SctpChecksumErrors),
SCTP_SNMP_ENTRY(SctpOutCtrlChunks),
SCTP_SNMP_ENTRY(SctpOutOrderChunks),
SCTP_SNMP_ENTRY(SctpOutUnorderChunks),
SCTP_SNMP_ENTRY(SctpInCtrlChunks),
SCTP_SNMP_ENTRY(SctpInOrderChunks),
SCTP_SNMP_ENTRY(SctpInUnorderChunks),
SCTP_SNMP_ENTRY(SctpFragUsrMsgs),
SCTP_SNMP_ENTRY(SctpReasmUsrMsgs),
SCTP_SNMP_ENTRY(SctpOutSCTPPacks),
SCTP_SNMP_ENTRY(SctpInSCTPPacks),
#undef SCTP_SNMP_ENTRY
struct snmp_mib sctp_snmp_list[] = {
SNMP_MIB_ITEM("SctpCurrEstab", SCTP_MIB_CURRESTAB),
SNMP_MIB_ITEM("SctpActiveEstabs", SCTP_MIB_ACTIVEESTABS),
SNMP_MIB_ITEM("SctpPassiveEstabs", SCTP_MIB_PASSIVEESTABS),
SNMP_MIB_ITEM("SctpAborteds", SCTP_MIB_ABORTEDS),
SNMP_MIB_ITEM("SctpShutdowns", SCTP_MIB_SHUTDOWNS),
SNMP_MIB_ITEM("SctpOutOfBlues", SCTP_MIB_OUTOFBLUES),
SNMP_MIB_ITEM("SctpChecksumErrors", SCTP_MIB_CHECKSUMERRORS),
SNMP_MIB_ITEM("SctpOutCtrlChunks", SCTP_MIB_OUTCTRLCHUNKS),
SNMP_MIB_ITEM("SctpOutOrderChunks", SCTP_MIB_OUTORDERCHUNKS),
SNMP_MIB_ITEM("SctpOutUnorderChunks", SCTP_MIB_OUTUNORDERCHUNKS),
SNMP_MIB_ITEM("SctpInCtrlChunks", SCTP_MIB_INCTRLCHUNKS),
SNMP_MIB_ITEM("SctpInOrderChunks", SCTP_MIB_INORDERCHUNKS),
SNMP_MIB_ITEM("SctpInUnorderChunks", SCTP_MIB_INUNORDERCHUNKS),
SNMP_MIB_ITEM("SctpFragUsrMsgs", SCTP_MIB_FRAGUSRMSGS),
SNMP_MIB_ITEM("SctpReasmUsrMsgs", SCTP_MIB_REASMUSRMSGS),
SNMP_MIB_ITEM("SctpOutSCTPPacks", SCTP_MIB_OUTSCTPPACKS),
SNMP_MIB_ITEM("SctpInSCTPPacks", SCTP_MIB_INSCTPPACKS),
};
/* Return the current value of a particular entry in the mib by adding its
......@@ -88,9 +86,10 @@ static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
{
int i;
for (i = 0; i < sizeof(sctp_snmp_list) / sizeof(char *); i++)
seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i],
fold_field((void **)sctp_statistics, i));
for (i = 0; sctp_snmp_list[i].name != NULL; i++)
seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
fold_field((void **)sctp_statistics,
sctp_snmp_list[i].entry));
return 0;
}
......
......@@ -808,7 +808,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
NIPQUAD(((struct rtable *)skb->dst)->rt_src),
NIPQUAD(((struct rtable *)skb->dst)->rt_dst));
SCTP_INC_STATS(SctpOutSCTPPacks);
SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
return ip_queue_xmit(skb, ipfragok);
}
......
This diff is collapsed.
......@@ -334,7 +334,7 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff *f_frag,
};
event = sctp_skb2event(f_frag);
SCTP_INC_STATS(SctpReasmUsrMsgs);
SCTP_INC_STATS(SCTP_MIB_REASMUSRMSGS);
return event;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment