MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / is_mcast

Function is_mcast

ip_addr.c:211–226  ·  view source on GitHub ↗

Returns 1 if the given address is a multicast address */

Source from the content-addressed store, hash-verified

209
210/* Returns 1 if the given address is a multicast address */
211int is_mcast(struct ip_addr* ip)
212{
213 if (!ip){
214 LM_ERR("invalid parameter value\n");
215 return -1;
216 }
217
218 if (ip->af==AF_INET){
219 return IN_MULTICAST(htonl(ip->u.addr32[0]));
220 } else if (ip->af==AF_INET6){
221 return IN6_IS_ADDR_MULTICAST((struct in6_addr *)(void *)ip->u.addr);
222 } else {
223 LM_ERR("unsupported protocol family\n");
224 return -1;
225 }
226}
227
228int mk_net_cidr(const str *cidr, struct net *out_net)
229{

Callers 1

fix_socketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected