gtphub: add logging labels to bind struct.
Allow logging the plane (Ctrl/User) and side (SGSN/GGSN) in functions that only have a gtphub_bind* to work with, by adding a constant label to each bind. Sponsored-by: On-Waves ehi
This commit is contained in:
parent
a208c734a2
commit
390e910125
|
@ -370,6 +370,8 @@ struct gtphub_bind {
|
||||||
|
|
||||||
/* list of struct gtphub_peer */
|
/* list of struct gtphub_peer */
|
||||||
struct llist_head peers;
|
struct llist_head peers;
|
||||||
|
|
||||||
|
const char *label; /* For logging */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gtphub_resolved_ggsn {
|
struct gtphub_resolved_ggsn {
|
||||||
|
|
|
@ -1787,6 +1787,11 @@ void gtphub_init(struct gtphub *hub)
|
||||||
gtphub_bind_init(&hub->to_ggsns[plane_idx]);
|
gtphub_bind_init(&hub->to_ggsns[plane_idx]);
|
||||||
gtphub_bind_init(&hub->to_sgsns[plane_idx]);
|
gtphub_bind_init(&hub->to_sgsns[plane_idx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hub->to_sgsns[GTPH_PLANE_CTRL].label = "SGSN Ctrl";
|
||||||
|
hub->to_ggsns[GTPH_PLANE_CTRL].label = "GGSN Ctrl";
|
||||||
|
hub->to_sgsns[GTPH_PLANE_USER].label = "SGSN User";
|
||||||
|
hub->to_ggsns[GTPH_PLANE_USER].label = "GGSN User";
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gtphub_make_proxy(struct gtphub *hub,
|
static int gtphub_make_proxy(struct gtphub *hub,
|
||||||
|
@ -1981,7 +1986,8 @@ static struct gtphub_peer_addr *gtphub_addr_have(struct gtphub *hub,
|
||||||
|
|
||||||
a = gtphub_peer_add_addr(peer, addr);
|
a = gtphub_peer_add_addr(peer, addr);
|
||||||
|
|
||||||
LOG("New peer address: %s\n",
|
LOG("New peer address: %s %s\n",
|
||||||
|
bind->label,
|
||||||
gsn_addr_to_str(&a->addr));
|
gsn_addr_to_str(&a->addr));
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
|
|
Loading…
Reference in New Issue