Move m_fixhdr() from "mbchain" to "mbuf" where it belongs.

This commit is contained in:
Poul-Henning Kamp 2002-09-18 13:41:37 +00:00
parent 0b7bc80226
commit 3f2e06c5e1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103540
4 changed files with 15 additions and 16 deletions

View File

@ -54,20 +54,6 @@ MODULE_VERSION(libmchain, 1);
/*
* Various helper functions
*/
int
m_fixhdr(struct mbuf *m0)
{
struct mbuf *m = m0;
int len = 0;
while (m) {
len += m->m_len;
m = m->m_next;
}
m0->m_pkthdr.len = len;
return len;
}
int
mb_init(struct mbchain *mbp)
{

View File

@ -710,3 +710,17 @@ m_print(const struct mbuf *m)
}
return;
}
int
m_fixhdr(struct mbuf *m0)
{
struct mbuf *m = m0;
int len = 0;
while (m) {
len += m->m_len;
m = m->m_next;
}
m0->m_pkthdr.len = len;
return len;
}

View File

@ -480,6 +480,7 @@ void m_copy_pkthdr(struct mbuf *to, struct mbuf *from);
struct mbuf *m_devget(char *, int, int, struct ifnet *,
void (*copy)(char *, caddr_t, u_int));
struct mbuf *m_dup(struct mbuf *, int);
int m_fixhdr(struct mbuf *m);
struct mbuf *m_free(struct mbuf *);
void m_freem(struct mbuf *);
struct mbuf *m_get(int, short);

View File

@ -134,8 +134,6 @@ struct mdchain {
u_char * md_pos; /* offset in the current mbuf */
};
int m_fixhdr(struct mbuf *m);
int mb_init(struct mbchain *mbp);
void mb_initm(struct mbchain *mbp, struct mbuf *m);
void mb_done(struct mbchain *mbp);