httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@hyperreal.com>
Subject cvs commit: apache/htdocs/manual/misc vif-info.html
Date Wed, 22 Jan 1997 18:22:39 GMT
brian       97/01/22 10:22:39

  Modified:    htdocs/manual/misc  vif-info.html
  Log:
  HTML-escaped the code, otherwise < and > were interpreted as tag demarkers - eek.
  
  Revision  Changes    Path
  1.3       +26 -26    apache/htdocs/manual/misc/vif-info.html
  
  Index: vif-info.html
  ===================================================================
  RCS file: /export/home/cvs/apache/htdocs/manual/misc/vif-info.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -C3 -r1.2 -r1.3
  *** vif-info.html	1996/12/05 05:48:20	1.2
  --- vif-info.html	1997/01/22 18:22:37	1.3
  ***************
  *** 99,105 ****
    
    --------------------
    #include "vif.h"
  ! #if NVIF > 0
    int     vifopen(), vifclose(), vifread(), vifwrite(), vifselect(), vifioctl();
    #else
    #define vifopen         nodev
  --- 99,105 ----
    
    --------------------
    #include "vif.h"
  ! #if NVIF &gt; 0
    int     vifopen(), vifclose(), vifread(), vifwrite(), vifselect(), vifioctl();
    #else
    #define vifopen         nodev
  ***************
  *** 187,201 ****
    	register struct ifnet *ifp;
            int	vifoutput(), vififioctl();
    	
  ! 	for (i=0; i<NVIF; i++)
    	{
    		ifp = &vif_softc[i].vif_if;
  ! 		ifp->if_name = "vif";
  ! 		ifp->if_unit = i;
  ! 		ifp->if_mtu = VIFMTU;
  ! 		ifp->if_flags = IFF_LOOPBACK | IFF_NOARP;
  ! 		ifp->if_ioctl = vififioctl;
  ! 		ifp->if_output = vifoutput;
    		if_attach(ifp);
    	}
    }
  --- 187,201 ----
    	register struct ifnet *ifp;
            int	vifoutput(), vififioctl();
    	
  ! 	for (i=0; i&lt;NVIF; i++)
    	{
    		ifp = &vif_softc[i].vif_if;
  ! 		ifp-&gt;if_name = "vif";
  ! 		ifp-&gt;if_unit = i;
  ! 		ifp-&gt;if_mtu = VIFMTU;
  ! 		ifp-&gt;if_flags = IFF_LOOPBACK | IFF_NOARP;
  ! 		ifp-&gt;if_ioctl = vififioctl;
  ! 		ifp-&gt;if_output = vifoutput;
    		if_attach(ifp);
    	}
    }
  ***************
  *** 213,219 ****
    	}
    	
    	unit = minor(dev);
  ! 	if ((unit < 0) || (unit >= NVIF))
    	{
    		return ENXIO;
    	}
  --- 213,219 ----
    	}
    	
    	unit = minor(dev);
  ! 	if ((unit &lt; 0) || (unit &gt;= NVIF))
    	{
    		return ENXIO;
    	}
  ***************
  *** 252,292 ****
    	struct mbuf *m;
    	struct sockaddr_in *din;
    	
  ! 	if (dst->sa_family != AF_INET)
    	{
    		printf("%s%d: can't handle af%d\n", 
  ! 		       ifp->if_name, ifp->if_unit,
  ! 		       dst->sa_family);
    		m_freem(m0);
    		return (EAFNOSUPPORT);
    	}
    
    	din = (struct sockaddr_in *)dst;
    	
  ! 	if (din->sin_addr.s_addr == IA_SIN(ifp->if_addrlist)->sin_addr.s_addr)
    	{
  ! 		/* printf("%s%d: looping\n", ifp->if_name, ifp->if_unit); */
    		
    		/*
    		 * Place interface pointer before the data
    		 * for the receiving protocol.
    		 */
  ! 		if (m0->m_off <= MMAXOFF &&
  ! 		    m0->m_off >= MMINOFF + sizeof(struct ifnet *)) {
  ! 			m0->m_off -= sizeof(struct ifnet *);
  ! 			m0->m_len += sizeof(struct ifnet *);
    		} else {
    			MGET(m, M_DONTWAIT, MT_HEADER);
    			if (m == (struct mbuf *)0)
    			  return (ENOBUFS);
  ! 			m->m_off = MMINOFF;
  ! 			m->m_len = sizeof(struct ifnet *);
  ! 			m->m_next = m0;
    			m0 = m;
    		}
    		*(mtod(m0, struct ifnet **)) = ifp;
    		s = splimp();
  ! 		ifp->if_opackets++;
    		ifq = &ipintrq;
    		if (IF_QFULL(ifq)) {
    			IF_DROP(ifq);
  --- 252,292 ----
    	struct mbuf *m;
    	struct sockaddr_in *din;
    	
  ! 	if (dst-&gt;sa_family != AF_INET)
    	{
    		printf("%s%d: can't handle af%d\n", 
  ! 		       ifp-&gt;if_name, ifp-&gt;if_unit,
  ! 		       dst-&gt;sa_family);
    		m_freem(m0);
    		return (EAFNOSUPPORT);
    	}
    
    	din = (struct sockaddr_in *)dst;
    	
  ! 	if (din-&gt;sin_addr.s_addr == IA_SIN(ifp-&gt;if_addrlist)-&gt;sin_addr.s_addr)
    	{
  ! 		/* printf("%s%d: looping\n", ifp-&gt;if_name, ifp-&gt;if_unit); */
    		
    		/*
    		 * Place interface pointer before the data
    		 * for the receiving protocol.
    		 */
  ! 		if (m0-&gt;m_off &lt;= MMAXOFF &&
  ! 		    m0-&gt;m_off &gt;= MMINOFF + sizeof(struct ifnet *)) {
  ! 			m0-&gt;m_off -= sizeof(struct ifnet *);
  ! 			m0-&gt;m_len += sizeof(struct ifnet *);
    		} else {
    			MGET(m, M_DONTWAIT, MT_HEADER);
    			if (m == (struct mbuf *)0)
    			  return (ENOBUFS);
  ! 			m-&gt;m_off = MMINOFF;
  ! 			m-&gt;m_len = sizeof(struct ifnet *);
  ! 			m-&gt;m_next = m0;
    			m0 = m;
    		}
    		*(mtod(m0, struct ifnet **)) = ifp;
    		s = splimp();
  ! 		ifp-&gt;if_opackets++;
    		ifq = &ipintrq;
    		if (IF_QFULL(ifq)) {
    			IF_DROP(ifq);
  ***************
  *** 296,302 ****
    		}
    		IF_ENQUEUE(ifq, m0);
    		schednetisr(NETISR_IP);
  ! 		ifp->if_ipackets++;
    		splx(s);
    		return (0);
    	}
  --- 296,302 ----
    		}
    		IF_ENQUEUE(ifq, m0);
    		schednetisr(NETISR_IP);
  ! 		ifp-&gt;if_ipackets++;
    		splx(s);
    		return (0);
    	}
  ***************
  *** 318,324 ****
    	switch (cmd) {
    
    	case SIOCSIFADDR:
  ! 		ifp->if_flags |= IFF_UP;
    		/*
    		 * Everything else is done at a higher level.
    		 */
  --- 318,324 ----
    	switch (cmd) {
    
    	case SIOCSIFADDR:
  ! 		ifp-&gt;if_flags |= IFF_UP;
    		/*
    		 * Everything else is done at a higher level.
    		 */
  ***************
  *** 339,345 ****
    	int unit;
    	
    	unit = minor(dev);
  ! 	if ((unit < 0) || (unit >= NVIF))
    	  return ENXIO;
    	
    	return EINVAL;
  --- 339,345 ----
    	int unit;
    	
    	unit = minor(dev);
  ! 	if ((unit &lt; 0) || (unit &gt;= NVIF))
    	  return ENXIO;
    	
    	return EINVAL;
  ***************
  *** 354,360 ****
    (or whatever major number it ended up being), and echo something into
    it:
    
  ! # echo > /dev/vif
    
    This will cause the device to be opened, which will if_attach the
    interfaces. If you feel like playing with the code, you may want to
  --- 354,360 ----
    (or whatever major number it ended up being), and echo something into
    it:
    
  ! # echo &gt; /dev/vif
    
    This will cause the device to be opened, which will if_attach the
    interfaces. If you feel like playing with the code, you may want to
  
  
  

Mime
View raw message