Home | History | Annotate | Download | only in slirp

Lines Matching defs:ip

70 /* m->m_data  points at ip packet header
71 * m->m_len length ip packet
72 * ip->ip_len length data (IPDU)
77 register struct ip *ip;
81 struct ip save_ip;
91 * Strip IP options, if any; should skip this,
96 if(iphlen > sizeof(struct ip)) {
98 iphlen = sizeof(struct ip);
102 * Get IP and UDP header together in first mbuf.
104 ip = mtod(m, struct ip *);
105 uh = (struct udphdr *)((caddr_t)ip + iphlen);
113 if (ip->ip_len != len) {
114 if (len > ip->ip_len) {
118 m_adj(m, len - ip->ip_len);
119 ip->ip_len = len;
123 * Save a copy of the IP header in case we want restore it
126 save_ip = *ip;
133 memset(&((struct ipovly *)ip)->ih_mbuf, 0, sizeof(struct mbuf_ptr));
134 ((struct ipovly *)ip)->ih_x1 = 0;
135 ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
137 * uh->uh_sum = cksum(m, len + sizeof (struct ip));
140 if(cksum(m, len + sizeof(struct ip))) {
170 so->so_laddr.s_addr != ip->ip_src.s_addr) {
175 tmp->so_laddr.s_addr == ip->ip_src.s_addr) {
176 tmp->so_faddr.s_addr = ip->ip_dst.s_addr;
207 so->so_laddr = ip->ip_src;
211 so->so_iptos = ip->ip_tos;
219 so->so_faddr = ip->ip_dst; /* XXX */
235 *ip=save_ip;
245 *ip=save_ip;
282 ui->ui_len = htons(m->m_len - sizeof(struct ip)); /* + sizeof (struct udphdr)); */
298 ((struct ip *)ui)->ip_len = m->m_len;
300 ((struct ip *)ui)->ip_ttl = IPDEFTTL;
301 ((struct ip *)ui)->ip_tos = iptos;
497 * The port number of the tcp socket and our IP