rlocs: Move debug outputter to common code
This commit is contained in:
@@ -409,6 +409,36 @@ ssize_t rloc_encrypt( struct rloc *rloc, unsigned char *data, size_t data_len, u
|
||||
return RSA_public_encrypt( data_len, data, dest, rloc->key, RSA_PKCS1_OAEP_PADDING );
|
||||
}
|
||||
|
||||
void rlocs_debug_output( struct rlocs *reg )
|
||||
{
|
||||
int i;
|
||||
char addr1[128], addr2[128];
|
||||
|
||||
info( "Configuration has parsed as:" );
|
||||
for( i = 0 ; i < reg->num_entries; i++ ) {
|
||||
struct rloc *current = ®->entries[i];
|
||||
inet_ntop( current->family, ¤t->addr, &addr1[0], 128 );
|
||||
|
||||
info( "RLOC %i: family %i, address %s", i, current->family, &addr1[0] );
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < reg->num_ip4_map_entries ; i++ ) {
|
||||
struct ip4_eid_map_entry *current = ®->ip4_mappings[i];
|
||||
inet_ntop( AF_INET, ¤t->network, &addr1[0], 128 );
|
||||
inet_ntop( AF_INET, ¤t->rloc->addr, &addr2[0], 128 );
|
||||
info( "IPv4 EID mapping %i: %s/%u => %s", i, addr1, current->mask, addr2 );
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < reg->num_ip6_map_entries ; i++ ) {
|
||||
struct ip6_eid_map_entry *current = ®->ip6_mappings[i];
|
||||
inet_ntop( AF_INET6, ¤t->network, &addr1[0], 128 );
|
||||
inet_ntop( AF_INET6, ¤t->rloc->addr, &addr2[0], 128 );
|
||||
info( "IPv6 EID mapping %i: %s/%u => %s", i, addr1, current->mask, addr2 );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void rlocs_free( struct rlocs* registry )
|
||||
{
|
||||
|
Reference in New Issue
Block a user