Home | History | Annotate | Download | only in slirp-android

Lines Matching defs:ip

75   register struct ip *ip=mtod(m, struct ip *);
76 int icmplen=ip->ip_len;
113 ip->ip_len += hlen; /* since ip_input subtracts this */
114 if (ip_geth(ip->ip_dst) == alias_addr_ip) {
131 so->so_faddr_ip = ip_geth(ip->ip_dst);
133 so->so_laddr_ip = ip_geth(ip->ip_src);
135 so->so_iptos = ip->ip_tos;
161 } /* if ip->ip_dst.s_addr == alias_addr.s_addr */
189 * RFC 1122: 3.2.2 MUST send at least the IP header and 8 bytes of header. MAY send more (we do).
191 * MUST NOT reply to a multicast/broadcast IP address.
198 * It is reported as the bad ip packet. The header should
201 * packet. The maximum payload is 576-20(ip hdr)-8(icmp hdr)=548
210 register struct ip *ip;
222 ip = mtod(msrc, struct ip *);
225 strcpy(bufa, inet_iptostr(ip_geth(ip->ip_src)));
226 strcpy(bufb, inet_iptostr(ip_geth(ip->ip_dst)));
230 if(ip->ip_off & IP_OFFMASK) goto end_error; /* Only reply to fragment 0 */
232 shlen=ip->ip_hl << 2;
233 s_ip_len=ip->ip_len;
234 if(ip->ip_p == IPPROTO_ICMP) {
235 icp = (struct icmp *)((char *)ip + shlen);
246 new_m_size=sizeof(struct ip )+ICMP_MINLEN+msrc->m_len+ICMP_MAXDATALEN;
253 ip = mtod(m, struct ip *);
254 hlen= sizeof(struct ip ); /* no options in reply */
268 /* min. size = 8+sizeof(struct ip)+8 */
275 memcpy(&icp->icmp_ip, msrc->m_data, s_ip_len); /* report the ip packet */
298 /* fill in ip */
299 ip->ip_hl = hlen >> 2;
300 ip->ip_len = m->m_len;
302 ip->ip_tos=((ip->ip_tos & 0x1E) | 0xC0); /* high priority for errors */
304 ip->ip_ttl = MAXTTL;
305 ip->ip_p = IPPROTO_ICMP;
306 ip->ip_dst = ip->ip_src; /* ip adresses */
307 ip->ip_src = ip_setn(alias_addr_ip);
319 * Reflect the ip packet back to the source
324 register struct ip *ip = mtod(m, struct ip *);
325 int hlen = ip->ip_hl << 2;
326 int optlen = hlen - sizeof(struct ip );
330 * Send an icmp packet back to the ip level,
338 icp->icmp_cksum = cksum(m, ip->ip_len - hlen);
343 /* fill in ip */
347 * mbuf's data back, and adjust the IP length.
349 memmove((caddr_t)(ip + 1), (caddr_t)ip + hlen,
352 ip->ip_hl = hlen >> 2;
353 ip->ip_len -= optlen;
357 ip->ip_ttl = MAXTTL;
360 icmp_dst = ip->ip_dst;
361 ip->ip_dst = ip->ip_src;
362 ip->ip_src = icmp_dst;