Map of routes, all of a same Rem type.
MapRoute.node[lvl][id] is a RouteNode class, i.e. a list of routes having as destination the node (lvl, id)
int
levels, int
gsize, NIP me, GNodeID[] id_myself, AddressManager address_manager)
string
report_status ()
uint32
report_status_hash ()
int
level_of_gnode)
int
lvl)
int
get_my_id ()
bool
is_in_my_network (NetworkID netid)
bool
is_preferred_network (NetworkID netid)
int
level)
A node which wants to rest assured that its GID at level lvl is valid will launch handle_check_gid. This
will start operations (if not already in progress) and make sure that for a certain time
from now the check will be periodically sent in broadcast until a response (ok or rehook)
is received or the time expires.
Note that handle_check_gid is not a microfunc and when it returns we can immediately add an id to its answer_queue.
When a node receives such a request and it is in the same gnode, it will launch handle_check_gid. Then it adds
the received request_id to the answer_queue for the level.
To formulate the request to be sent, a node generates a request_id. It will use this request_id in all messages
sent until response/expiration.
When a response is received that is for us and is ok, the same answer is sent again in broadcast to all the id
that we have in answer_queue.
When a response is received that is for us and is rehook, the maproute emits a signal that will cause the
ntkd_node to start a rehook. The signal contains all data needed to reply the same answer after the rehook has
been completed. The reply will occurr only after the node has is_mature, because, until then, the node will not
be able to serve a hook request.
The exact sequence of operations when ntkd_node detects the signal is:
| . (assert the splitted was a primary_address)
| . start rehook from primary_address to [answering_nip]
| . tc=TimeCapsule(xx)
| . while True:
| . if tc.expired(): break
| . if rehook failed: break
| . if addresses.primary_address.is_mature:
| . for queued_id in queue:
| . broadcast_client.maproute.answer_gid( \
| . addresses.primary_address.maproute.me, \
| . queued_id, \
| . actual_gid)
| . break
| . swait a bit
| So, the data needed with the signal 'GNODE_SPLITTED' are: (neighbours=[answering_nip], queue, actual_gid)
|Note_1: An address_manager nom-autonomous will ignore messages request_gid.
|Note_2: An address_manager nom-autonomous that detects a possible gnode split will start handle_check_gid, but if
| it receives a rehook then it just dies. (this check is in ntkd_node)
|Note_3: An address_manager that has not is_mature will ignore messages request_gid.
int
level)
int
level) throws RPCError
int
request_id, NetworkID gnetid, PartialNIP gprefix) throws RPCError
List
<int
> queue, GNodeID actual_gid) throws RPCError
int
request_id, GNodeID actual_gid) throws RPCError
int
level_of_gnode)
int
? get_distance (int
lvl, int
pos)
List
<HCoord> hops, GNodeID? gid)
int
lvl, int
dst, AggregatedNeighbour gw)
int
lvl, int
dst)
int
lvl, int
dst)
List
<PartialNIP> choose_from)
List
<PartialNIP> choose_from)
List
<AggregatedNeighbour> passed_neighbour_list, List
<int
> queue_of_request_ids, GNodeID actual_gid)
int
level)