Lines Matching refs:ip
178 static int parseline(line, ip, ifn, out) in parseline() argument
180 ip_t *ip;
191 bzero((char *)ip, MAX(sizeof(*tcp), sizeof(*ic)) + sizeof(*ip));
195 IP_HL_A(ip, sizeof(*ip) >> 2);
196 IP_V_A(ip, IPVERSION);
224 ip->ip_len = sizeof(ip_t);
228 ip->ip_p = IPPROTO_TCP;
229 ip->ip_len += sizeof(struct tcphdr);
232 ip->ip_p = IPPROTO_UDP;
233 ip->ip_len += sizeof(struct udphdr);
236 ip->ip_p = IPPROTO_ICMP;
237 ip->ip_len += ICMPERR_IPICMPHLEN;
242 ip->ip_p = atoi(*cpp);
245 ip->ip_p = IPPROTO_IP;
249 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP) {
259 if (ip->ip_p == IPPROTO_TCP) {
264 ip->ip_src.s_addr = tx_hostnum(*cpp, &r);
269 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP) {
280 ip->ip_dst.s_addr = tx_hostnum(*cpp, &r);
282 if (*cpp && ip->ip_p == IPPROTO_TCP) {
295 } else if (*cpp && ip->ip_p == IPPROTO_ICMP) {
315 olen = buildopts(*cpp, ipopts, (IP_HL(ip) - 5) << 2);
317 bcopy(ipopts, (char *)(ip + 1), olen);
318 IP_HL_A(ip, IP_HL(ip) + (olen >> 2));
321 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP)
322 bcopy((char *)tcp, ((char *)ip) + (IP_HL(ip) << 2),
324 else if (ip->ip_p == IPPROTO_ICMP)
325 bcopy((char *)ic, ((char *)ip) + (IP_HL(ip) << 2),
327 ip->ip_len = htons(ip->ip_len);