Deleted Added
full compact
mbuf.c (38544) mbuf.c (43693)
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 *
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 * $Id: mbuf.c,v 1.21 1998/08/21 18:10:15 brian Exp $
20 * $Id: mbuf.c,v 1.22 1998/08/25 17:48:42 brian Exp $
21 *
22 */
23#include <sys/types.h>
24
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28#include <sysexits.h>

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

109 nb = bp->cnt;
110 else
111 nb = len;
112 memcpy(ptr, MBUF_CTOP(bp), nb);
113 ptr += nb;
114 bp->cnt -= nb;
115 len -= nb;
116 bp->offset += nb;
21 *
22 */
23#include <sys/types.h>
24
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28#include <sysexits.h>

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

109 nb = bp->cnt;
110 else
111 nb = len;
112 memcpy(ptr, MBUF_CTOP(bp), nb);
113 ptr += nb;
114 bp->cnt -= nb;
115 len -= nb;
116 bp->offset += nb;
117 if (bp->cnt == 0) {
118#ifdef notdef
119 bp = bp->next;
120#else
117 if (bp->cnt == 0)
121 bp = mbuf_FreeSeg(bp);
118 bp = mbuf_FreeSeg(bp);
122#endif
123 }
124 }
125 return (bp);
126}
127
128void
129mbuf_Write(struct mbuf * bp, u_char * ptr, int cnt)
130{
131 int plen;

--- 80 unchanged lines hidden ---
119 }
120 return (bp);
121}
122
123void
124mbuf_Write(struct mbuf * bp, u_char * ptr, int cnt)
125{
126 int plen;

--- 80 unchanged lines hidden ---