|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1988 University of Utah. ! 3: * Copyright (c) 1990 The Regents of the University of California. ! 4: * All rights reserved. ! 5: * ! 6: * This code is derived from software contributed to Berkeley by ! 7: * the Systems Programming Group of the University of Utah Computer ! 8: * Science Department. ! 9: * ! 10: * Redistribution is only permitted until one year after the first shipment ! 11: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and ! 12: * binary forms are permitted provided that: (1) source distributions retain ! 13: * this entire copyright notice and comment, and (2) distributions including ! 14: * binaries display the following acknowledgement: This product includes ! 15: * software developed by the University of California, Berkeley and its ! 16: * contributors'' in the documentation or other materials provided with the ! 17: * distribution and in all advertising materials mentioning features or use ! 18: * of this software. Neither the name of the University nor the names of ! 19: * its contributors may be used to endorse or promote products derived from ! 20: * this software without specific prior written permission. ! 21: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 22: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 23: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 24: * ! 25: * from: Utah $Hdr: rmp.c 1.3 89/06/07$ ! 26: * ! 27: * @(#)rmp.c 7.1 (Berkeley) 5/8/90 ! 28: */ ! 29: ! 30: #include "param.h" ! 31: #include "mbuf.h" ! 32: #include "socket.h" ! 33: #include "socketvar.h" ! 34: ! 35: #include "../net/if.h" ! 36: #include "../net/route.h" ! 37: #include "../net/raw_cb.h" ! 38: ! 39: #include "../netrmp/rmp.h" ! 40: #include "../netrmp/rmp_var.h" ! 41: ! 42: /* ! 43: ** rmp_output: route packet to proper network interface. ! 44: */ ! 45: ! 46: rmp_output(m, so) ! 47: struct mbuf *m; ! 48: struct socket *so; ! 49: { ! 50: struct ifnet *ifp; ! 51: struct rawcb *rp = sotorawcb(so); ! 52: struct rmp_packet *rmp; ! 53: ! 54: /* ! 55: * Convert the mbuf back to an RMP packet so we can get the ! 56: * address of the "ifnet struct" specifying the interface it ! 57: * should go out on. ! 58: */ ! 59: rmp = mtod(m, struct rmp_packet *); ! 60: ifp = rmp->ifp; ! 61: ! 62: /* ! 63: * Strip off the "ifnet struct ptr" from the packet leaving ! 64: * us with a complete IEEE 802.2 packet. ! 65: */ ! 66: m_adj(m, sizeof(struct ifnet *)); ! 67: ! 68: /* ! 69: * Send the packet. ! 70: */ ! 71: return ((*ifp->if_output) (ifp, m, &rp->rcb_faddr)); ! 72: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.