Deleted Added
sdiff udiff text old ( 55146 ) new ( 55353 )
full compact
1/*
2 * PPP Memory handling module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $FreeBSD: head/usr.sbin/ppp/mbuf.c 55146 1999-12-27 11:54:57Z brian $
21 *
22 */
23#include <sys/types.h>
24
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28#include <sysexits.h>

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

229 memcpy(bp + 1, (const char *)ptr + len, bp->m_offset);
230 bp->m_len += bp->m_offset;
231 bp->m_offset = 0;
232 }
233
234 head = m_get(len + extra, bp ? bp->m_type : MB_UNKNOWN);
235 head->m_offset = extra;
236 head->m_len -= extra;
237 memcpy(MBUF_CTOP(head), ptr, len);
238 head->m_next = bp;
239
240 return head;
241}
242
243struct mbuf *
244m_adj(struct mbuf *bp, ssize_t n)
245{

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

393 if (type != bp->m_type) {
394 MemMap[bp->m_type].fragments--;
395 MemMap[bp->m_type].octets -= bp->m_size;
396 bp->m_type = type;
397 MemMap[type].fragments++;
398 MemMap[type].octets += bp->m_size;
399 }
400}