libosmo-sigtran 2.0.0.52-6412
Osmocom SIGTRAN library
ss7_asp_peer.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5#include <unistd.h>
6
7/***********************************************************************
8 * SS7 ASP Peer
9 ***********************************************************************/
10
12 char *host[OSMO_SOCK_MAX_ADDRS];
13 size_t host_cnt;
14 uint16_t port;
15 /* index in "hosts" array marking the SCTP Primary Address, -1 if no explicit Primary Address set */
17};
18
19int ss7_asp_peer_snprintf(char *buf, size_t buf_len, struct osmo_ss7_asp_peer *peer);
20void ss7_asp_peer_init(struct osmo_ss7_asp_peer *peer);
21int ss7_asp_peer_set_hosts(struct osmo_ss7_asp_peer *peer, void *talloc_ctx,
22 const char *const*hosts, size_t host_cnt);
23int ss7_asp_peer_set_hosts2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx,
24 const char *const*hosts, size_t host_cnt, int idx_primary);
25int ss7_asp_peer_add_host(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host);
26int ss7_asp_peer_add_host2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host, bool is_primary_addr);
27int ss7_asp_peer_del_host(struct osmo_ss7_asp_peer *peer, const char *host);
28
29bool ss7_asp_peer_match_host(const struct osmo_ss7_asp_peer *peer, const char *host, bool host_is_v6);
30int ss7_asp_peer_find_host(const struct osmo_ss7_asp_peer *peer, const char *host);
void ss7_asp_peer_init(struct osmo_ss7_asp_peer *peer)
Definition: osmo_ss7_asp_peer.c:48
int ss7_asp_peer_find_host(const struct osmo_ss7_asp_peer *peer, const char *host)
Find the exact IP address match and return its index in the array.
Definition: osmo_ss7_asp_peer.c:286
int ss7_asp_peer_snprintf(char *buf, size_t buf_len, struct osmo_ss7_asp_peer *peer)
Definition: osmo_ss7_asp_peer.c:54
int ss7_asp_peer_set_hosts2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const *hosts, size_t host_cnt, int idx_primary)
Set (copy) addresses for a given ASP peer.
Definition: osmo_ss7_asp_peer.c:94
int ss7_asp_peer_set_hosts(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const *hosts, size_t host_cnt)
Set (copy) addresses for a given ASP peer.
Definition: osmo_ss7_asp_peer.c:122
int ss7_asp_peer_add_host2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host, bool is_primary_addr)
Append (copy) address to a given ASP peer.
Definition: osmo_ss7_asp_peer.c:143
int ss7_asp_peer_add_host(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host)
Append (copy) address to a given ASP peer.
Definition: osmo_ss7_asp_peer.c:261
int ss7_asp_peer_del_host(struct osmo_ss7_asp_peer *peer, const char *host)
Remove address from a given ASP peer.
Definition: osmo_ss7_asp_peer.c:216
bool ss7_asp_peer_match_host(const struct osmo_ss7_asp_peer *peer, const char *host, bool host_is_v6)
Definition: osmo_ss7_asp_peer.c:267
Definition: ss7_asp_peer.h:11
size_t host_cnt
Definition: ss7_asp_peer.h:13
uint16_t port
Definition: ss7_asp_peer.h:14
char * host[OSMO_SOCK_MAX_ADDRS]
Definition: ss7_asp_peer.h:12
int idx_primary
Definition: ss7_asp_peer.h:16