Lines Matching refs:ip
83 #include <netinet/ip.h>
106 static int igmp_input_v1_query(struct ifnet *, const struct ip *,
108 static int igmp_input_v2_query(struct ifnet *, const struct ip *,
110 static int igmp_input_v3_query(struct ifnet *, const struct ip *,
114 static int igmp_input_v1_report(struct ifnet *, /*const*/ struct ip *,
116 static int igmp_input_v2_report(struct ifnet *, /*const*/ struct ip *,
693 igmp_input_v1_query(struct ifnet *ifp, const struct ip *ip,
707 if (!in_allhosts(ip->ip_dst) || !in_nullhost(igmp->igmp_group)) {
778 igmp_input_v2_query(struct ifnet *ifp, const struct ip *ip,
798 if (!in_allhosts(ip->ip_dst))
930 igmp_input_v3_query(struct ifnet *ifp, const struct ip *ip,
989 if (!in_allhosts(ip->ip_dst) || nsrc > 0) {
1196 igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip,
1209 !in_hosteq(igmp->igmp_group, ip->ip_dst)) {
1221 if (V_igmp_recvifkludge && in_nullhost(ip->ip_src)) {
1225 ip->ip_src.s_addr = htonl(ia->ia_subnet);
1307 igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip,
1321 if (ia != NULL && in_hosteq(ip->ip_src, IA_SIN(ia)->sin_addr)) {
1334 !in_hosteq(igmp->igmp_group, ip->ip_dst)) {
1347 if (V_igmp_recvifkludge && in_nullhost(ip->ip_src)) {
1349 ip->ip_src.s_addr = htonl(ia->ia_subnet);
1418 struct ip *ip;
1432 ip = mtod(m, struct ip *);
1434 igmplen = ntohs(ip->ip_len) - iphlen;
1459 ip = mtod(m, struct ip *);
1480 if (igmp->igmp_type != IGMP_DVMRP && ip->ip_ttl != 1) {
1506 if (igmp_input_v1_query(ifp, ip, igmp) != 0) {
1516 if (igmp_input_v2_query(ifp, ip, igmp) != 0) {
1553 if (igmp_input_v3_query(ifp, ip, igmpv3) != 0) {
1565 if (igmp_input_v1_report(ifp, ip, igmp) != 0) {
1576 if (igmp_input_v2_report(ifp, ip, igmp) != 0) {
2185 struct ip *ip;
2196 M_ALIGN(m, sizeof(struct ip) + sizeof(struct igmp));
2198 m->m_pkthdr.len = sizeof(struct ip) + sizeof(struct igmp);
2200 m->m_data += sizeof(struct ip);
2210 m->m_data -= sizeof(struct ip);
2211 m->m_len += sizeof(struct ip);
2213 ip = mtod(m, struct ip *);
2214 ip->ip_tos = 0;
2215 ip->ip_len = htons(sizeof(struct ip) + sizeof(struct igmp));
2216 ip->ip_off = 0;
2217 ip->ip_p = IPPROTO_IGMP;
2218 ip->ip_src.s_addr = INADDR_ANY;
2221 ip->ip_dst.s_addr = htonl(INADDR_ALLRTRS_GROUP);
2223 ip->ip_dst = inm->inm_addr;
3482 struct ip *ip;
3489 hdrlen = sizeof(struct ip) + sizeof(struct igmp_report);
3502 m->m_data += sizeof(struct ip);
3503 m->m_len -= sizeof(struct ip);
3514 m->m_data -= sizeof(struct ip);
3515 m->m_len += sizeof(struct ip);
3517 ip = mtod(m, struct ip *);
3518 ip->ip_tos = IPTOS_PREC_INTERNETCONTROL;
3519 ip->ip_len = htons(hdrlen + igmpreclen);
3520 ip->ip_off = htons(IP_DF);
3521 ip->ip_p = IPPROTO_IGMP;
3522 ip->ip_sum = 0;
3524 ip->ip_src.s_addr = INADDR_ANY;
3532 ip->ip_src = ia->ia_addr.sin_addr;
3536 ip->ip_dst.s_addr = htonl(INADDR_ALLRPTS_GROUP);