| 487 | |
| 488 | |
| 489 | int get_source_group(struct sip_msg* msg, pv_spec_t *out_var, |
| 490 | struct pm_part_struct *part) |
| 491 | { |
| 492 | int group; |
| 493 | struct ip_addr *ip; |
| 494 | pv_value_t pvt; |
| 495 | |
| 496 | ip = &msg->rcv.src_ip; |
| 497 | LM_DBG("Looking for <%s, %u> in address table\n", |
| 498 | ip_addr2a(ip), msg->rcv.src_port); |
| 499 | |
| 500 | group = pm_hash_find_group(*part->hash_table, |
| 501 | ip, msg->rcv.src_port); |
| 502 | if (group == -1) return -1; |
| 503 | LM_DBG("Found <%d>\n", group); |
| 504 | |
| 505 | pvt.flags = PV_VAL_INT|PV_TYPE_INT; |
| 506 | pvt.rs.s = NULL; |
| 507 | pvt.rs.len = 0; |
| 508 | pvt.ri = group; |
| 509 | |
| 510 | if (pv_set_value(msg, out_var, (int)EQ_T, &pvt) < 0) { |
| 511 | LM_ERR("setting of pvar failed\n"); |
| 512 | return -1; |
| 513 | } |
| 514 | |
| 515 | return 1; |
| 516 | } |
nothing calls this directly
no test coverage detected