Lines Matching defs:vifp

682     struct vif *vifp = viftable + vifcp->vifc_vifi;
691 if (vifp->v_lcl_addr.s_addr != 0) return EADDRINUSE;
722 bzero(&vifp->v_route, sizeof(vifp->v_route));
739 vifp->v_tbf = v_tbf;
740 GET_TIME(vifp->v_tbf->tbf_last_pkt_t);
741 vifp->v_tbf->tbf_n_tok = 0;
742 vifp->v_tbf->tbf_q_len = 0;
743 vifp->v_tbf->tbf_max_q_len = MAXQSIZE;
744 vifp->v_tbf->tbf_q = vifp->v_tbf->tbf_t = NULL;
746 vifp->v_flags = vifcp->vifc_flags;
747 vifp->v_threshold = vifcp->vifc_threshold;
748 vifp->v_lcl_addr = vifcp->vifc_lcl_addr;
749 vifp->v_rmt_addr = vifcp->vifc_rmt_addr;
750 vifp->v_ifp = ifp;
752 vifp->v_rate_limit= vifcp->vifc_rate_limit * 1024 / 1000;
753 vifp->v_rsvp_on = 0;
754 vifp->v_rsvpd = NULL;
756 vifp->v_pkt_in = 0;
757 vifp->v_pkt_out = 0;
758 vifp->v_bytes_in = 0;
759 vifp->v_bytes_out = 0;
782 struct vif *vifp = &viftable[vifi];
788 if (vifp->v_lcl_addr.s_addr == 0) return EADDRNOTAVAIL;
790 if (!(vifp->v_flags & VIFF_TUNNEL)) {
793 ifp = vifp->v_ifp;
797 if (vifp == last_encap_vif) {
805 while (vifp->v_tbf->tbf_q) {
806 m = vifp->v_tbf->tbf_q;
807 vifp->v_tbf->tbf_q = m->m_act;
811 bzero((caddr_t)vifp->v_tbf, sizeof(*(vifp->v_tbf)));
812 bzero((caddr_t)vifp, sizeof (*vifp));
1076 struct vif *vifp;
1109 vifp = viftable + vifi;
1112 (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
1113 vifp->v_ifp->if_name, vifp->v_ifp->if_unit);
1341 struct vif *vifp;
1349 #define MC_SEND(ip,vifp,m) { \
1350 if ((vifp)->v_flags & VIFF_TUNNEL) \
1351 encap_send((ip), (vifp), (m)); \
1353 phyint_send((ip), (vifp), (m)); \
1436 for (vifp = viftable, vifi = 0; vifi < numvifs; vifp++, vifi++)
1439 vifp->v_pkt_out++;
1440 vifp->v_bytes_out += plen;
1441 MC_SEND(ip, vifp, m);
1481 phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m)
1497 if (vifp->v_rate_limit == 0)
1498 tbf_send_packet(vifp, mb_copy);
1500 tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
1504 encap_send(struct ip *ip, struct vif *vifp, struct mbuf *m)
1519 mac_mbuf_label_associate_multicast_encap(m, vifp->v_ifp, mb_copy);
1547 ip_copy->ip_src = vifp->v_lcl_addr;
1548 ip_copy->ip_dst = vifp->v_rmt_addr;
1566 if (vifp->v_rate_limit == 0)
1567 tbf_send_packet(vifp, mb_copy);
1569 tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
1587 struct vif *vifp;
1608 vifp = viftable;
1609 vife = vifp + numvifs;
1612 for ( ; vifp < vife; ++vifp)
1613 if (vifp->v_rmt_addr.s_addr == ip->ip_src.s_addr) {
1614 if ((vifp->v_flags & (VIFF_TUNNEL|VIFF_SRCRT))
1616 last_encap_vif = vifp;
1620 if ((vifp = last_encap_vif) == 0) {
1629 ifp = vifp->v_ifp;
1646 tbf_control(struct vif *vifp, struct mbuf *m, struct ip *ip,
1649 struct tbf *t = vifp->v_tbf;
1658 tbf_update_tokens(vifp);
1669 tbf_send_packet(vifp, m);
1672 tbf_queue(vifp, m);
1673 timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
1677 tbf_queue(vifp, m);
1678 tbf_process_q(vifp);
1681 if (!tbf_dq_sel(vifp, ip)) {
1686 tbf_queue(vifp, m);
1687 tbf_process_q(vifp);
1697 tbf_queue(struct vif *vifp, struct mbuf *m)
1699 struct tbf *t = vifp->v_tbf;
1727 tbf_process_q(struct vif *vifp)
1731 struct tbf *t = vifp->v_tbf;
1754 tbf_send_packet(vifp, m);
1763 struct vif *vifp = xvifp;
1769 tbf_update_tokens(vifp);
1771 tbf_process_q(vifp);
1773 if (vifp->v_tbf->tbf_q_len)
1774 timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
1781 tbf_dq_sel(struct vif *vifp, struct ip *ip)
1786 struct tbf *t = vifp->v_tbf;
1788 p = priority(vifp, ip);
1793 if (p > priority(vifp, mtod(m, struct ip *))) {
1813 tbf_send_packet(struct vif *vifp, struct mbuf *m)
1818 if (vifp->v_flags & VIFF_TUNNEL) {
1820 ip_output(m, (struct mbuf *)0, &vifp->v_route,
1831 imo->imo_multicast_ifp = vifp->v_ifp;
1849 vifp - viftable, error);
1858 tbf_update_tokens(struct vif *vifp)
1862 struct tbf *t = vifp->v_tbf;
1877 t->tbf_n_tok += tm * vifp->v_rate_limit / 1024 / 8;
1885 priority(__unused struct vif *vifp, struct ip *ip)