! \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) */
| 234 | * unsaved result of this function (static buffer) |
| 235 | */ |
| 236 | int 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 | } |
| 244 | found: |
| 245 | return 1; |
| 246 | } |
| 247 | |
| 248 | |
| 249 |
no test coverage detected