diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2014-09-19 10:39:58 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2014-09-19 10:39:58 +0000 |
commit | 3751dddb3e546d8c31867e491790da2b9d9215e0 (patch) | |
tree | ae7a412373b8b159264640a0e35e6f3eaac332a7 /sys/net/if_spppsubr.c | |
parent | a001989d9be9626ede5c70875fcf24cb44761069 (diff) | |
download | src-3751dddb3e546d8c31867e491790da2b9d9215e0.tar.gz src-3751dddb3e546d8c31867e491790da2b9d9215e0.zip |
Mechanically convert to if_inc_counter().
Notes
Notes:
svn path=/head/; revision=271867
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r-- | sys/net/if_spppsubr.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 3340612e6ff5..9dc55c5ba12c 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -518,7 +518,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) if (ifp->if_flags & IFF_UP) /* Count received bytes, add FCS and one flag */ - ifp->if_ibytes += m->m_pkthdr.len + 3; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len + 3); if (m->m_pkthdr.len <= PPP_HEADER_LEN) { /* Too small packet, drop it. */ @@ -530,8 +530,8 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) m_freem (m); SPPP_UNLOCK(sp); drop2: - ++ifp->if_ierrors; - ++ifp->if_iqdrops; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } @@ -570,7 +570,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) sppp_cp_send (sp, PPP_LCP, PROTO_REJ, ++sp->pp_seq[IDX_LCP], m->m_pkthdr.len + 2, &h->protocol); - ++ifp->if_noproto; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto drop; case PPP_LCP: sppp_cp_input(&lcp, sp, m); @@ -682,7 +682,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) } switch (ntohs (h->protocol)) { default: - ++ifp->if_noproto; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto invalid; case CISCO_KEEPALIVE: sppp_cisco_input (sp, m); @@ -906,7 +906,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, nobufs: if (debug) log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n", SPP_ARGS(ifp)); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); SPPP_UNLOCK(sp); return (ENOBUFS); } @@ -966,7 +966,7 @@ nobufs: if (debug) #endif default: m_freem (m); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); SPPP_UNLOCK(sp); return (EAFNOSUPPORT); } @@ -981,7 +981,7 @@ out: else IFQ_HANDOFF_ADJ(ifp, m, 3, error); if (error) { - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); SPPP_UNLOCK(sp); return (rv? rv: ENOBUFS); } @@ -1393,7 +1393,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2) (u_long)ch->par2, (u_int)ch->rel, (u_int)ch->time0, (u_int)ch->time1); if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -1442,7 +1442,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type, log(-1, ">\n"); } if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -1484,7 +1484,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) log(-1, SPP_FMT "%s invalid conf-req length %d\n", SPP_ARGS(ifp), cp->name, len); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } /* handle states where RCR doesn't get a SCA/SCN */ @@ -1540,7 +1540,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case CONF_ACK: @@ -1549,7 +1549,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n", SPP_ARGS(ifp), cp->name, h->ident, sp->confid[cp->protoidx]); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } switch (sp->state[cp->protoidx]) { @@ -1584,7 +1584,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case CONF_NAK: @@ -1594,7 +1594,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n", SPP_ARGS(ifp), cp->name, h->ident, sp->confid[cp->protoidx]); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } if (h->type == CONF_NAK) @@ -1634,7 +1634,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; @@ -1667,7 +1667,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case TERM_ACK: @@ -1698,7 +1698,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case CODE_REJ: @@ -1725,7 +1725,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case PROTO_REJ: @@ -1784,7 +1784,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; } @@ -1800,7 +1800,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) if (debug) log(-1, SPP_FMT "lcp echo req but lcp closed\n", SPP_ARGS(ifp)); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } if (len < 8) { @@ -1834,7 +1834,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) if (cp->proto != PPP_LCP) goto illegal; if (h->ident != sp->lcp.echoid) { - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } if (len < 8) { @@ -1859,7 +1859,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) SPP_ARGS(ifp), cp->name, h->type); sppp_cp_send(sp, cp->proto, CODE_REJ, ++sp->pp_seq[cp->protoidx], m->m_pkthdr.len, h); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } } @@ -4740,7 +4740,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, log(-1, ">\n"); } if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* |