projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint further progress, still doesn't connect tho.
[unix-history]
/
usr
/
src
/
sys
/
netiso
/
iso_chksum.c
diff --git
a/usr/src/sys/netiso/iso_chksum.c
b/usr/src/sys/netiso/iso_chksum.c
index
5668f93
..
95a1fe4
100644
(file)
--- a/
usr/src/sys/netiso/iso_chksum.c
+++ b/
usr/src/sys/netiso/iso_chksum.c
@@
-1,3
+1,12
@@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ *
+ * @(#)iso_chksum.c 7.8 (Berkeley) %G%
+ */
+
/***********************************************************
Copyright IBM Corporation 1987
/***********************************************************
Copyright IBM Corporation 1987
@@
-48,13
+57,10
@@
SOFTWARE.
*/
#ifdef ISO
*/
#ifdef ISO
-#ifndef lint
-static char *rcsid = "$Header: iso_chksum.c,v 4.7 88/07/29 15:31:26 nhall Exp $";
-#endif
-
-#include "argo_debug.h"
-#include "param.h"
-#include "mbuf.h"
+#include <netiso/argo_debug.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
#endif ISO
#ifndef MNULL
#endif ISO
#ifndef MNULL
@@
-90,7
+96,7
@@
iso_check_csum(m, len)
int l;
l = len;
int l;
l = len;
- len =
MIN
(m->m_len, len);
+ len =
min
(m->m_len, len);
i = 0;
IFDEBUG(D_CHKSUM)
i = 0;
IFDEBUG(D_CHKSUM)
@@
-114,7
+120,7
@@
iso_check_csum(m, len)
l,i,m->m_data);
ENDDEBUG
ASSERT( m != MNULL);
l,i,m->m_data);
ENDDEBUG
ASSERT( m != MNULL);
- len =
MIN
( m->m_len, l-i);
+ len =
min
( m->m_len, l-i);
p = mtod(m, u_char *);
}
}
p = mtod(m, u_char *);
}
}
@@
-166,9
+172,9
@@
iso_gen_csum(m,n,l)
ENDDEBUG
while(i < l) {
ENDDEBUG
while(i < l) {
- len =
MIN
(m->m_len, CLBYTES);
+ len =
min
(m->m_len, CLBYTES);
/* RAH: don't cksum more than l bytes */
/* RAH: don't cksum more than l bytes */
- len =
MIN(len, l
);
+ len =
min(len, l - i
);
cum +=len;
p = mtod(m, u_char *);
cum +=len;
p = mtod(m, u_char *);
@@
-222,22
+228,6
@@
iso_gen_csum(m,n,l)
ENDDEBUG
}
ENDDEBUG
}
-struct mbuf *
-m_append(head, m)
- struct mbuf *head, *m;
-{
- register struct mbuf *n;
-
- if (m == 0)
- return head;
- if (head == 0)
- return m;
- n = head;
- while (n->m_next)
- n = n->m_next;
- n->m_next = m;
- return head;
-}
/*
* FUNCTION: m_datalen
*
/*
* FUNCTION: m_datalen
*
@@
-252,23
+242,13
@@
m_append(head, m)
*/
int
*/
int
-m_datalen (m
orig
)
-
struct mbuf *morig
;
+m_datalen (m)
+
register struct mbuf *m
;
{
{
- int s = splimp();
- register struct mbuf *n=morig;
- register int datalen = 0;
+ register int datalen;
- if( morig == (struct mbuf *)0)
- return 0;
- for(;;) {
- datalen += n->m_len;
- if (n->m_next == (struct mbuf *)0 ) {
- break;
- }
- n = n->m_next;
- }
- splx(s);
+ for (datalen = 0; m; m = m->m_next)
+ datalen += m->m_len;
return datalen;
}
return datalen;
}
@@
-317,7
+297,7
@@
m_compress(in, out)
int len;
len = M_TRAILINGSPACE(*out);
int len;
len = M_TRAILINGSPACE(*out);
- len =
MIN
(len, in->m_len);
+ len =
min
(len, in->m_len);
datalen += len;
IFDEBUG(D_REQUEST)
datalen += len;
IFDEBUG(D_REQUEST)