|
int ether_outpu(struct ifnet *ifp,struct mbuf *m0,struct sockaddr *dst,struct rtentry *rt0);
m0指的是第一个链表还是所有的链表呢。如果是所有链表那么下面的代码怎么解释呢?
short type;
u_char edst[6];
struct arpcom *ac;
struct ether_header *eh=mtod(m,struct ether_header *);
short type = htons((u_short)type);
bcopy((caddr_t)&type,(caddr_t)&eh->ether_type,
sizeof(eh->ether_type));
bcopy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof (edst));
bcopy((caddr_t)ac->ac_enaddr, (caddr_t)eh->ether_shost,
sizeof(eh->ether_shost));
这里面mbuf怎么样将全部的内容正好转换成ether_header结构的呢。谢谢大伙帮忙解释一下。 |
|