Callbacks¶
Rtrlib provides 3 callbacks one for updates on the manager status, one for pfx_table and one for spki_table updates.
RTR Manager Status Callback¶
This callback is called when the RTR Managers status is changed. The callback function must take 4 arguments.
-
manager_status_callback
(rtr_mgr_group, group_status, rtr_socket, data)¶ Parameters:
This callback is registered at manager initialization using status_callback parameter. The data object may be passed with the status_callback_data parameter.
PFX iteration callback¶
This callback can be used to iterate over the entire pfx table.
-
pfx_for_each
(pfx_record, data)¶ pfx_record is only guaranteed to be valid during this function call. If you want to store it somewhere e.g. in data than you have to copy it. you can use
rtrlib.records.copy_pfx_record()
for this.Parameters:
Warning
You should not register more than one function per callback for the following callbacks, it will not work and result in undefined behaviour
PFX update callback¶
This callback is called for any change to the Prefix validation table, it takes two arguments.
-
pfx_update_callback(pfx_record, added):
Parameters: - pfx_record (
rtrlib.records.PFXRecord
) – The affected pfx record - added (
bool
) – Indicates whether the record was added or removed
- pfx_record (
This callback can be registered using the rtrlib.register_pfx_update_callback()
function
SPKI update callback¶
This callback is called for any change to the Subject Public Key Info table, it takes two arguments.
-
spki_update_callback(spki_record, added):
Parameters: - spki_record (
rtrlib.records.PFXRecord
) – The affected spki record - added (
bool
) – Indicates whether the record was added or removed
- spki_record (
This callback can be registered using the rtrlib.register_spki_update_callback()
function
-
rtrlib.
register_spki_update_callback
(func)[source]¶ Register RTR manager spki update callback
Warning
This callback is untested, because at the time of writing no caching server with spki records was available. It should work but might cause you computer to explode.
Parameters: func (function) – Callback function