Lines Matching refs:ip

81 #include <netinet/ip.h>
104 static int igmp_input_v1_query(struct ifnet *, const struct ip *,
106 static int igmp_input_v2_query(struct ifnet *, const struct ip *,
108 static int igmp_input_v3_query(struct ifnet *, const struct ip *,
112 static int igmp_input_v1_report(struct ifnet *, /*const*/ struct ip *,
114 static int igmp_input_v2_report(struct ifnet *, /*const*/ struct ip *,
704 igmp_input_v1_query(struct ifnet *ifp, const struct ip *ip,
718 if (!in_allhosts(ip->ip_dst) || !in_nullhost(igmp->igmp_group)) {
789 igmp_input_v2_query(struct ifnet *ifp, const struct ip *ip,
809 if (!in_allhosts(ip->ip_dst))
941 igmp_input_v3_query(struct ifnet *ifp, const struct ip *ip,
1000 if (!in_allhosts(ip->ip_dst) || nsrc > 0) {
1207 igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip,
1220 !in_hosteq(igmp->igmp_group, ip->ip_dst)) {
1232 if (V_igmp_recvifkludge && in_nullhost(ip->ip_src)) {
1235 ip->ip_src.s_addr = htonl(ia->ia_subnet);
1318 igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip,
1331 if (ia != NULL && in_hosteq(ip->ip_src, IA_SIN(ia)->sin_addr)) {
1345 !in_hosteq(igmp->igmp_group, ip->ip_dst)) {
1359 if (V_igmp_recvifkludge && in_nullhost(ip->ip_src)) {
1361 ip->ip_src.s_addr = htonl(ia->ia_subnet);
1431 struct ip *ip;
1445 ip = mtod(m, struct ip *);
1447 igmplen = ntohs(ip->ip_len) - iphlen;
1472 ip = mtod(m, struct ip *);
1493 if (igmp->igmp_type != IGMP_DVMRP && ip->ip_ttl != 1) {
1519 if (igmp_input_v1_query(ifp, ip, igmp) != 0) {
1529 if (igmp_input_v2_query(ifp, ip, igmp) != 0) {
1565 if (igmp_input_v3_query(ifp, ip, igmpv3) != 0) {
1577 if (igmp_input_v1_report(ifp, ip, igmp) != 0) {
1588 if (igmp_input_v2_report(ifp, ip, igmp) != 0) {
2198 struct ip *ip;
2209 M_ALIGN(m, sizeof(struct ip) + sizeof(struct igmp));
2211 m->m_pkthdr.len = sizeof(struct ip) + sizeof(struct igmp);
2213 m->m_data += sizeof(struct ip);
2223 m->m_data -= sizeof(struct ip);
2224 m->m_len += sizeof(struct ip);
2226 ip = mtod(m, struct ip *);
2227 ip->ip_tos = 0;
2228 ip->ip_len = htons(sizeof(struct ip) + sizeof(struct igmp));
2229 ip->ip_off = 0;
2230 ip->ip_p = IPPROTO_IGMP;
2231 ip->ip_src.s_addr = INADDR_ANY;
2234 ip->ip_dst.s_addr = htonl(INADDR_ALLRTRS_GROUP);
2236 ip->ip_dst = inm->inm_addr;
3497 struct ip *ip;
3504 hdrlen = sizeof(struct ip) + sizeof(struct igmp_report);
3517 m->m_data += sizeof(struct ip);
3518 m->m_len -= sizeof(struct ip);
3529 m->m_data -= sizeof(struct ip);
3530 m->m_len += sizeof(struct ip);
3532 ip = mtod(m, struct ip *);
3533 ip->ip_tos = IPTOS_PREC_INTERNETCONTROL;
3534 ip->ip_len = htons(hdrlen + igmpreclen);
3535 ip->ip_off = htons(IP_DF);
3536 ip->ip_p = IPPROTO_IGMP;
3537 ip->ip_sum = 0;
3539 ip->ip_src.s_addr = INADDR_ANY;
3546 ip->ip_src = ia->ia_addr.sin_addr;
3551 ip->ip_dst.s_addr = htonl(INADDR_ALLRPTS_GROUP);