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

Function check_addr

modules/permissions/address.c:452–469  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

450 *
451 */
452int check_addr(struct sip_msg* msg, int* grp, str* s_ip, int *port, long proto,
453 pv_spec_t *info, char *pattern, struct pm_part_struct *part)
454{
455 struct ip_addr *ip;
456
457 /* ip addr */
458 if ( (ip=str2ip(s_ip))==NULL && (ip=str2ip6(s_ip))==NULL ) {
459 LM_ERR("invalid ip address <%.*s>!\n", s_ip->len, s_ip->s);
460 return -1;
461 }
462
463 LM_DBG("Looking for : <%.*s:%d, %.*s, %d, %d, %s>\n",
464 part->name.len, part->name.s, *grp,
465 s_ip->len, s_ip->s, (int)proto, *port, ZSW(pattern) );
466
467 return pm_hash_match(msg, *part->hash_table, *grp,
468 ip, *port, (int)proto, pattern, info);
469}
470
471
472int check_src_addr(struct sip_msg *msg, int *grp,

Callers

nothing calls this directly

Calls 3

str2ipFunction · 0.85
str2ip6Function · 0.85
pm_hash_matchFunction · 0.85

Tested by

no test coverage detected