summaryrefslogtreecommitdiff
path: root/proto/bmp/bmp.c
diff options
context:
space:
mode:
authorMichal Zagorski <mzagorsk@akamai.com>2023-05-30 17:09:25 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-05-30 17:09:25 +0200
commit62d8fbdc1cb3d358b0d20d7b10bd3f17f357d567 (patch)
tree8191901307820bb9ddebfa7ec4d4c4b5e900b373 /proto/bmp/bmp.c
parentae4d934c53cdc4cc5ec3d4535cd5138fdf9b25cb (diff)
BMP: Add local address option
Also remove unused local and ip_post_policy options. Co-authored with Pawel Maslanka <pmaslank@akamai.com>. Minor changes by committer.
Diffstat (limited to 'proto/bmp/bmp.c')
-rw-r--r--proto/bmp/bmp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/proto/bmp/bmp.c b/proto/bmp/bmp.c
index ca508049..7efa8f6a 100644
--- a/proto/bmp/bmp.c
+++ b/proto/bmp/bmp.c
@@ -892,6 +892,7 @@ bmp_connect(struct bmp_proto *p)
sock *sk = sk_new(p->p.pool);
sk->type = SK_TCP_ACTIVE;
+ sk->saddr = p->local_addr;
sk->daddr = p->station_ip;
sk->dport = p->station_port;
sk->ttl = IP4_MAX_TTL;
@@ -970,26 +971,26 @@ bmp_init(struct proto_config *CF)
struct proto *P = proto_new(CF);
struct bmp_proto *p = (void *) P;
struct bmp_config *cf = (void *) CF;
-
p->cf = cf;
+ p->local_addr = cf->local_addr;
p->station_ip = cf->station_ip;
p->station_port = cf->station_port;
strcpy(p->sys_descr, cf->sys_descr);
strcpy(p->sys_name, cf->sys_name);
p->monitoring_rib.in_pre_policy = cf->monitoring_rib_in_pre_policy;
- p->monitoring_rib.in_post_policy = cf->monitoring_rib_in_post_policy;
- p->monitoring_rib.local = cf->monitoring_rib_local;
return P;
}
+/**
+ * bmp_start - initialize internal resources of BMP implementation.
+ * NOTE: It does not connect to BMP collector yet.
+ */
static int
bmp_start(struct proto *P)
{
struct bmp_proto *p = (void *) P;
- log(L_DEBUG "Init BMP");
-
p->buffer_mpool = rp_new(P->pool, "BMP Buffer");
p->map_mem_pool = rp_new(P->pool, "BMP Map");
p->tx_mem_pool = rp_new(P->pool, "BMP Tx");