Deleted Added
full compact
uipc_mbuf.c (132512) uipc_mbuf.c (135904)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
30 */
31
32#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1982, 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 132512 2004-07-21 21:03:01Z bmilekic $");
33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 135904 2004-09-28 18:40:18Z jmg $");
34
35#include "opt_mac.h"
36#include "opt_param.h"
37#include "opt_mbuf_stress_test.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>

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

990 }
991 m = m->m_next;
992 }
993 }
994 return (NULL);
995}
996
997void
34
35#include "opt_mac.h"
36#include "opt_param.h"
37#include "opt_mbuf_stress_test.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>

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

990 }
991 m = m->m_next;
992 }
993 }
994 return (NULL);
995}
996
997void
998m_print(const struct mbuf *m)
998m_print(const struct mbuf *m, int maxlen)
999{
1000 int len;
999{
1000 int len;
1001 int pdata;
1001 const struct mbuf *m2;
1002
1002 const struct mbuf *m2;
1003
1003 len = m->m_pkthdr.len;
1004 if (m->m_flags & M_PKTHDR)
1005 len = m->m_pkthdr.len;
1006 else
1007 len = -1;
1004 m2 = m;
1008 m2 = m;
1005 while (len) {
1006 printf("%p %*D\n", m2, m2->m_len, (u_char *)m2->m_data, "-");
1007 len -= m2->m_len;
1009 while (m2 != NULL && (len == -1 || len)) {
1010 pdata = m2->m_len;
1011 if (maxlen != -1 && pdata > maxlen)
1012 pdata = maxlen;
1013 printf("mbuf: %p len: %d, next: %p, %b%s", m2, m2->m_len,
1014 m2->m_next, m2->m_flags, "\20\20freelist\17skipfw"
1015 "\11proto5\10proto4\7proto3\6proto2\5proto1\4rdonly"
1016 "\3eor\2pkthdr\1ext", pdata ? "" : "\n");
1017 if (pdata)
1018 printf(", %*D\n", m2->m_len, (u_char *)m2->m_data, "-");
1019 if (len != -1)
1020 len -= m2->m_len;
1008 m2 = m2->m_next;
1009 }
1021 m2 = m2->m_next;
1022 }
1023 if (len > 0)
1024 printf("%d bytes unaccounted for.\n", len);
1010 return;
1011}
1012
1013u_int
1014m_fixhdr(struct mbuf *m0)
1015{
1016 u_int len;
1017

--- 240 unchanged lines hidden ---
1025 return;
1026}
1027
1028u_int
1029m_fixhdr(struct mbuf *m0)
1030{
1031 u_int len;
1032

--- 240 unchanged lines hidden ---