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

Function check_self

forward.c:236–246  ·  view source on GitHub ↗

! \brief checks if the proto: host:port is one of the address we listen on * * if port==0, the port number is ignored * if proto==0 (PROTO_NONE) the protocol is ignored * returns 1 if true, 0 if false, -1 on error * WARNING: uses str2ip6 so it will overwrite any previous * unsaved result of this function (static buffer) */

Source from the content-addressed store, hash-verified

234 * unsaved result of this function (static buffer)
235 */
236int check_self(str* host, unsigned short port, unsigned short proto)
237{
238 if (grep_sock_info(host, port, proto)) goto found;
239 /* try to look into the aliases*/
240 if (grep_aliases(host->s, host->len, port, proto)==0){
241 LM_DBG("host != me\n");
242 return 0;
243 }
244found:
245 return 1;
246}
247
248
249

Callers 10

w_is_myselfFunction · 0.85
forward_replyFunction · 0.85
topology_hiding_matchFunction · 0.85
ospGetRouteParamFunction · 0.85
ospGetNextHopFunction · 0.85
check_myselfFunction · 0.85
l_siplua_getRouteFunction · 0.85
l_siplua_isMyselfFunction · 0.85
api_match_dialogFunction · 0.85
is_myselfFunction · 0.85

Calls 1

grep_aliasesFunction · 0.85

Tested by

no test coverage detected