This commit is contained in:
2026-01-28 12:37:15 +08:00
parent a7252f5066
commit 022ef0ae8a
8 changed files with 80 additions and 44 deletions

View File

@@ -11,4 +11,12 @@ function is_dn42_prefix() {
NET_IP6: return net ~ DN42_PREFIXES_V6;
else: print "is_dn42_prefix: unexpected net.type ", net.type, " ", net; return false;
}
}
function is_dn42_self_net() {
case net.type {
NET_IP4: return net ~ IS_SELF_NET_dn42v4;
NET_IP6: return net ~ IS_SELF_NET_dn42v6;
else: print "is_dn42_prefix: unexpected net.type ", net.type, " ", net; return false;
}
}

7
bird/function/inet.conf Normal file
View File

@@ -0,0 +1,7 @@
function is_self_net() {
case net.type {
NET_IP4: return net ~ IS_SELF_NET_inet4;
NET_IP6: return net ~ IS_SELF_NET_inet6;
else: print "is_dn42_prefix: unexpected net.type ", net.type, " ", net; return false;
}
}

View File

@@ -6,13 +6,13 @@ function unet_is_valid_network_v4() {
function unet_is_valid_network_v4_allnet(){
if unet_is_valid_network_v4() then return true;
if is_self_net_inet4() then return true;
if is_self_net_dn42v4() then return true;
if is_self_net() then return true;
if is_dn42_self_net() then return true;
return false;
}
function unet_is_voalid_net_v6(){
if is_self_net_inet6() then return true;
if is_self_net_dn42v6() then return true;
if is_self_net() then return true;
if is_dn42_self_net() then return true;
return false;
}