@@ -108,26 +108,6 @@ static NS_LIST_DEFINE(duplicate_dua_tr_list, duplicate_dua_tr_t, link);
108
108
#define THREAD_BBR_DUA_DAD_QUERY_TIMEOUT 1 // wait period for Duplicate Address Detection
109
109
#define THREAD_BBR_DUA_DAD_REPEATS 2 // multicast repeated as part of DUA
110
110
111
- /*
112
- 0 – Successful registration
113
- 1 – Registration rejected: Registration Sequence Number is not newer
114
- 2 – Registration rejected: Target EID is not a valid DUA
115
- 3 – Registration rejected: DUA is already in use by another Device
116
- 4 – Registration rejected: BBR resource shortage
117
- 5 – Registration rejected: BBR is not Primary at this moment
118
- 6 – Registration failure: Reason(s) not further specified
119
- 7 – Registration failure: Backbone Link not operational
120
- */
121
- #define THREAD_BBR_STATUS_SUCCESS 0
122
- #define THREAD_BBR_STATUS_SEQ_NUMBER_OLD 1
123
- #define THREAD_BBR_STATUS_TARGET_EID_NOT_VALID 2
124
- #define THREAD_BBR_STATUS_DUA_ALREADY_IN_USE 3
125
- #define THREAD_BBR_STATUS_RESOURCE_SHORTAGE 4
126
- #define THREAD_BBR_STATUS_NOT_PRIMARY_BBR 5
127
- #define THREAD_BBR_STATUS_NOT_SPECIFIED 6
128
- #define THREAD_BBR_STATUS_BB_LINK_NOT_OPERATIONAL 7
129
-
130
-
131
111
static void thread_border_router_multicast_store_add (thread_pbbr_t * this , uint8_t * destination_addr_ptr );
132
112
static void thread_border_router_multicast_store_del (thread_pbbr_t * this , uint8_t * destination_addr_ptr );
133
113
static void thread_border_router_multicast_store_activate (thread_pbbr_t * this );
@@ -766,7 +746,7 @@ static int thread_extension_bbr_mlr_cb(int8_t service_id, uint8_t source_address
766
746
uint8_t * invalid_addr_ptr = NULL ;
767
747
uint32_t timeout_value ;
768
748
uint8_t bbr_rloc_addr [16 ];
769
- uint8_t bbr_status = THREAD_BBR_STATUS_SUCCESS ;
749
+ uint8_t bbr_status = THREAD_EXTENSION_ST_DUA_SUCCESS ;
770
750
uint8_t payload [4 + 18 ];
771
751
uint8_t * ptr ;
772
752
@@ -793,7 +773,7 @@ static int thread_extension_bbr_mlr_cb(int8_t service_id, uint8_t source_address
793
773
if (0 != thread_extension_primary_bbr_get (cur , bbr_rloc_addr , NULL , NULL , NULL ) ||
794
774
!addr_get_entry (cur , bbr_rloc_addr )) {
795
775
// Primary BBR not present or I am not BBR
796
- bbr_status = THREAD_BBR_STATUS_NOT_PRIMARY_BBR ;
776
+ bbr_status = THREAD_EXTENSION_ST_DUA_BBR_NOT_PRIMARY ;
797
777
goto send_response ;
798
778
}
799
779
@@ -803,7 +783,7 @@ static int thread_extension_bbr_mlr_cb(int8_t service_id, uint8_t source_address
803
783
tr_info ("message from commissioner" );
804
784
if (cur -> thread_info -> registered_commissioner .session_id != session_id ) {
805
785
tr_warn ("Invalid commissioner session id" );
806
- bbr_status = THREAD_BBR_STATUS_NOT_SPECIFIED ;
786
+ bbr_status = THREAD_EXTENSION_ST_DUA_GENERAL_FAILURE ;
807
787
goto send_response ;
808
788
}
809
789
thread_meshcop_tlv_data_get_uint32 (request_ptr -> payload_ptr , request_ptr -> payload_len , TMFCOP_TLV_TIMEOUT , & timeout_value );
@@ -819,15 +799,15 @@ static int thread_extension_bbr_mlr_cb(int8_t service_id, uint8_t source_address
819
799
if (addr_len >= 16 ) {
820
800
invalid_addr_ptr = addr_ptr ;
821
801
}
822
- bbr_status = THREAD_BBR_STATUS_TARGET_EID_NOT_VALID ;
802
+ bbr_status = THREAD_EXTENSION_ST_DUA_INVALID ;
823
803
goto send_response ;
824
804
}
825
805
826
806
while (remaining > 0 ) {
827
807
//Go through all addresses
828
808
if (!addr_is_ipv6_multicast (addr_ptr )) {
829
809
tr_err ("Invalid /n/mr not multicast address" );
830
- bbr_status = THREAD_BBR_STATUS_TARGET_EID_NOT_VALID ;
810
+ bbr_status = THREAD_EXTENSION_ST_DUA_INVALID ;
831
811
if (!invalid_addr_ptr ) {
832
812
invalid_addr_ptr = addr_ptr ;
833
813
}
@@ -887,7 +867,7 @@ static int thread_extension_bbr_dua_cb(int8_t service_id, uint8_t source_address
887
867
uint8_t bbr_rloc_addr [16 ];
888
868
uint8_t * ptr ;
889
869
bool entry_keep_alive = false;
890
- uint8_t bbr_status = THREAD_BBR_STATUS_SUCCESS ;
870
+ uint8_t bbr_status = THREAD_EXTENSION_ST_DUA_SUCCESS ;
891
871
892
872
tr_info ("Thread BBR DUA.req received" );
893
873
@@ -916,7 +896,7 @@ static int thread_extension_bbr_dua_cb(int8_t service_id, uint8_t source_address
916
896
if (0 == thread_extension_primary_bbr_get (cur , bbr_rloc_addr , NULL , NULL , NULL ) &&
917
897
!addr_get_entry (cur , bbr_rloc_addr )) {
918
898
// Primary pBBR present and I am not the pBBR
919
- bbr_status = THREAD_BBR_STATUS_NOT_PRIMARY_BBR ;
899
+ bbr_status = THREAD_EXTENSION_ST_DUA_BBR_NOT_PRIMARY ;
920
900
goto send_response ;
921
901
}
922
902
@@ -925,14 +905,14 @@ static int thread_extension_bbr_dua_cb(int8_t service_id, uint8_t source_address
925
905
926
906
if (addr_len < 16 || ml_eid_len < 8 ) {
927
907
tr_err ("Invalid /n/dr message" );
928
- bbr_status = THREAD_BBR_STATUS_NOT_SPECIFIED ;
908
+ bbr_status = THREAD_EXTENSION_ST_DUA_GENERAL_FAILURE ;
929
909
goto send_response ;
930
910
}
931
911
932
912
if (!bitsequal (addr_data_ptr , this -> domain_prefix , 64 )) {
933
913
// Prefix did not match
934
914
tr_warn ("Registration failed invalid address" );
935
- bbr_status = THREAD_BBR_STATUS_TARGET_EID_NOT_VALID ;
915
+ bbr_status = THREAD_EXTENSION_ST_DUA_INVALID ;
936
916
goto send_response ;
937
917
}
938
918
@@ -943,15 +923,15 @@ static int thread_extension_bbr_dua_cb(int8_t service_id, uint8_t source_address
943
923
944
924
// new device has generated duplicate dua
945
925
if (route != NULL && route -> info .info != NULL && memcmp (((thread_pbbr_dua_info_t * )route -> info .info )-> mleid_ptr , ml_eid_ptr , 8 ) != 0 ) {
946
- bbr_status = THREAD_BBR_STATUS_DUA_ALREADY_IN_USE ;
926
+ bbr_status = THREAD_EXTENSION_ST_DUA_DUPLICATE ;
947
927
goto send_response ;
948
928
}
949
929
if (route != NULL && route -> info .info != NULL && memcmp (((thread_pbbr_dua_info_t * )route -> info .info )-> mleid_ptr , ml_eid_ptr , 8 ) == 0 ) {
950
930
((thread_pbbr_dua_info_t * )route -> info .info )-> last_contact_time = protocol_core_monotonic_time ;
951
931
entry_keep_alive = true;
952
932
}
953
933
if (thread_bbr_dua_entry_add (this -> interface_id , addr_data_ptr , this -> dua_timeout * 2 , ml_eid_ptr ) != 0 ) {
954
- bbr_status = THREAD_BBR_STATUS_RESOURCE_SHORTAGE ;
934
+ bbr_status = THREAD_EXTENSION_ST_DUA_NO_RESOURCES ;
955
935
goto send_response ;
956
936
}
957
937
/*if (route && memcmp(route->info.next_hop_addr, ml_addr,16) != 0) {
0 commit comments