otherwise the session will not be established. This behavior is defined
in <rfc id="9234"> as "strict mode" and is used to enforce corresponding
configuration at your conterpart side. Default: disabled.
+
+ <tag><label id="bgp-tx_size_warning">tx size warning <m/number/</tag>
+ If this option is set, the bgp protocol prints warning when it consumes at least
+ given size of memory. This includes also the memory consumed
+ by any export table. Zero means disabled. Default: disabled.
</descrip>
<sect1>Channel configuration
/* And queue the notification */
if (bgp_update_prefix(c, bgp_get_prefix(c, NET_TO_INDEX(n), path, bc->add_path_tx), buck))
bgp_schedule_packet(p->conn, bc, PKT_UPDATE);
+
+ if ((p->cf->tx_size_warning > 0) )
+ {
+ struct resmem mem = rmemsize(P->pool);
+ if (mem.effective + mem.overhead >= p->cf->tx_size_warning)
+ log_rl(&p->tbf_mem, L_WARN "%s: Used %lu memory", P->name, mem.effective + mem.overhead);
+ }
}
ea_set_attr(&pes, EA_LITERAL_EMBEDDED(&ea_bgp_rem_as, 0, cf->remote_as));
proto_announce_state_later(&p->p, pes);
+
+ p->tbf_mem = (struct tbf) TBF_DEFAULT_LOG_LIMITS;
return P;
}
int require_hostname; /* Require remote support for hostname [draft] */
int require_gr; /* Require remote support for graceful restart [RFC 4724] */
int require_llgr; /* Require remote support for long-lived graceful restart [draft] */
+ uint tx_size_warning; /* The maximum amount of memory which is not logged as warning */
struct bfd_options *bfd; /* Use BFD for liveness detection */
};
u8 last_error_class; /* Error class of last error */
u32 last_error_code; /* Error code of last error. BGP protocol errors
are encoded as (bgp_err_code << 16 | bgp_err_subcode) */
+ struct tbf tbf_mem; /* For logging memory allocation */
};
#define bgp_ea_state(p) _Generic((p), \
LIVED, STALE, IMPORT, IBGP, EBGP, MANDATORY, INTERNAL, EXTERNAL, SETS,
DYNAMIC, RANGE, NAME, DIGITS, AIGP, ORIGINATE, COST, ENFORCE,
FIRST, FREE, VALIDATE, BASE, ROLE, ROLES, PEER, PROVIDER, CUSTOMER,
- RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL, SEND)
+ RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL, SEND, TX, SIZE, WARNING)
CF_ENUM(T_ENUM_BGP_ORIGIN, ORIGIN_, IGP, EGP, INCOMPLETE)
BGP_CFG->dynamic_name = "dynbgp";
BGP_CFG->check_link = -1;
BGP_CFG->send_hold_time = -1;
+ BGP_CFG->tx_size_warning = 0;
}
;
| bgp_proto LOCAL ROLE bgp_role_name ';' { BGP_CFG->local_role = $4; }
| bgp_proto REQUIRE ROLES bool ';' { BGP_CFG->require_roles = $4; }
| bgp_proto DISABLE RX bool ';' { BGP_CFG->disable_rx = $4; }
+ | bgp_proto TX SIZE WARNING expr ';' { BGP_CFG->tx_size_warning = $5; }
;
bgp_afi: