Deleted Added
full compact
ng_cisco.c (102244) ng_cisco.c (109623)
1
2/*
3 * ng_cisco.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

--- 22 unchanged lines hidden (view full) ---

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Julian Elischer <julian@freebsd.org>
38 *
1
2/*
3 * ng_cisco.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

--- 22 unchanged lines hidden (view full) ---

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Julian Elischer <julian@freebsd.org>
38 *
39 * $FreeBSD: head/sys/netgraph/ng_cisco.c 102244 2002-08-22 00:30:03Z archie $
39 * $FreeBSD: head/sys/netgraph/ng_cisco.c 109623 2003-01-21 08:56:16Z alfred $
40 * $Whistle: ng_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp $
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/errno.h>
46#include <sys/kernel.h>
47#include <sys/socket.h>

--- 307 unchanged lines hidden (view full) ---

355
356 /* If it came from our downlink, deal with it separately */
357 if (pep->af == 0xffff)
358 return (cisco_input(sc, item));
359
360 /* OK so it came from a protocol, heading out. Prepend general data
361 packet header. For now, IP,IPX only */
362 m = NGI_M(item); /* still associated with item */
40 * $Whistle: ng_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp $
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/errno.h>
46#include <sys/kernel.h>
47#include <sys/socket.h>

--- 307 unchanged lines hidden (view full) ---

355
356 /* If it came from our downlink, deal with it separately */
357 if (pep->af == 0xffff)
358 return (cisco_input(sc, item));
359
360 /* OK so it came from a protocol, heading out. Prepend general data
361 packet header. For now, IP,IPX only */
362 m = NGI_M(item); /* still associated with item */
363 M_PREPEND(m, CISCO_HEADER_LEN, M_DONTWAIT);
363 M_PREPEND(m, CISCO_HEADER_LEN, M_NOWAIT);
364 if (!m) {
365 error = ENOBUFS;
366 goto out;
367 }
368 h = mtod(m, struct cisco_header *);
369 h->address = CISCO_UNICAST;
370 h->control = 0;
371

--- 229 unchanged lines hidden (view full) ---

601 struct cisco_packet *ch;
602 struct mbuf *m;
603 u_long t;
604 int error = 0;
605 struct timeval time;
606
607 getmicrotime(&time);
608
364 if (!m) {
365 error = ENOBUFS;
366 goto out;
367 }
368 h = mtod(m, struct cisco_header *);
369 h->address = CISCO_UNICAST;
370 h->control = 0;
371

--- 229 unchanged lines hidden (view full) ---

601 struct cisco_packet *ch;
602 struct mbuf *m;
603 u_long t;
604 int error = 0;
605 struct timeval time;
606
607 getmicrotime(&time);
608
609 MGETHDR(m, M_DONTWAIT, MT_DATA);
609 MGETHDR(m, M_NOWAIT, MT_DATA);
610 if (!m)
611 return (ENOBUFS);
612
613 t = (time.tv_sec - boottime.tv_sec) * 1000;
614 m->m_pkthdr.len = m->m_len = CISCO_HEADER_LEN + CISCO_PACKET_LEN;
615 m->m_pkthdr.rcvif = 0;
616
617 h = mtod(m, struct cisco_header *);

--- 15 unchanged lines hidden ---
610 if (!m)
611 return (ENOBUFS);
612
613 t = (time.tv_sec - boottime.tv_sec) * 1000;
614 m->m_pkthdr.len = m->m_len = CISCO_HEADER_LEN + CISCO_PACKET_LEN;
615 m->m_pkthdr.rcvif = 0;
616
617 h = mtod(m, struct cisco_header *);

--- 15 unchanged lines hidden ---