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

This commit is contained in:
phk 2002-09-18 13:41:37 +00:00
parent aef6a01e62
commit 22fe384f6f
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);