@@ -33,8 +33,8 @@ struct NodeState {
3333/// Shared node state handle, cloneable and cheaply updatable.
3434///
3535/// Consumers call [`SharedNodeState::update_role`], [`SharedNodeState::update_capabilities`],
36- /// etc. after negotiation or listening starts so that `wallhack info` /
37- /// `wallhack_status` reflects the real state of the daemon.
36+ /// etc. after negotiation or listening starts so that `wallhack info`
37+ /// reflects the real state of the daemon.
3838#[ derive( Clone , Debug ) ]
3939pub struct SharedNodeState ( Arc < ArcSwap < NodeState > > ) ;
4040
@@ -148,7 +148,7 @@ impl Handler {
148148 /// Returns a handle to the shared node state.
149149 ///
150150 /// Callers (daemon modes) use this to update role, capabilities, and
151- /// listen/connect state after negotiation so that `status ()` reports
151+ /// listen/connect state after negotiation so that `info ()` reports
152152 /// accurate information.
153153 #[ must_use]
154154 pub fn node_state ( & self ) -> SharedNodeState {
@@ -396,9 +396,9 @@ impl crate::node_api::NodeApi for Handler {
396396 self . metrics . snapshot ( )
397397 }
398398
399- fn status ( & self ) -> crate :: node_api:: NodeStatus {
399+ fn info ( & self ) -> crate :: node_api:: NodeInfo {
400400 let state = self . state . load ( ) ;
401- crate :: node_api:: NodeStatus {
401+ crate :: node_api:: NodeInfo {
402402 role : state. role ,
403403 peer_addr : state. peer_addr . clone ( ) ,
404404 capabilities : state. capabilities ,
@@ -441,7 +441,7 @@ impl crate::node_api::NodeApi for Handler {
441441 Ok ( ( ) )
442442 }
443443
444- fn remove_route ( & self , cidr : & crate :: Cidr ) -> crate :: node_api:: Result < ( ) > {
444+ fn route_del ( & self , cidr : & crate :: Cidr ) -> crate :: node_api:: Result < ( ) > {
445445 if let Some ( entry) = self . routes . remove ( cidr) {
446446 let _ = self
447447 . route_updates
@@ -452,7 +452,7 @@ impl crate::node_api::NodeApi for Handler {
452452 }
453453 }
454454
455- fn disconnect_peer ( & self , peer : String ) -> crate :: node_api:: Result < ( ) > {
455+ fn peer_disconnect ( & self , peer : String ) -> crate :: node_api:: Result < ( ) > {
456456 // Try name prefix first, then fall back to exact address match.
457457 // Used by REPL/CLI where prefix matching is convenient.
458458 let peer_info = self . peers . find_by_prefix ( & peer) . or_else ( |e| {
@@ -467,7 +467,7 @@ impl crate::node_api::NodeApi for Handler {
467467 Ok ( ( ) )
468468 }
469469
470- fn disconnect_peer_by_id ( & self , id : String ) -> crate :: node_api:: Result < ( ) > {
470+ fn peer_disconnect_by_id ( & self , id : String ) -> crate :: node_api:: Result < ( ) > {
471471 // Exact match on registry key. Used by REST API where the id
472472 // is taken directly from the peers list.
473473 if self . peers . get ( & id) . is_none ( ) {
@@ -481,12 +481,12 @@ impl crate::node_api::NodeApi for Handler {
481481 self . state . load ( ) . role
482482 }
483483
484- fn set_hint ( & self , hint : RoleHint ) -> crate :: node_api:: Result < ( ) > {
484+ fn hint_set ( & self , hint : RoleHint ) -> crate :: node_api:: Result < ( ) > {
485485 self . hint_tx . send_replace ( Some ( hint) ) ;
486486 Ok ( ( ) )
487487 }
488488
489- fn clear_hints ( & self ) -> crate :: node_api:: Result < ( ) > {
489+ fn hint_set_auto ( & self ) -> crate :: node_api:: Result < ( ) > {
490490 self . hint_tx . send_replace ( None ) ;
491491 Ok ( ( ) )
492492 }
@@ -738,7 +738,7 @@ mod tests {
738738 }
739739
740740 #[ test]
741- fn test_status_indeterminate_role ( ) {
741+ fn test_info_indeterminate_role ( ) {
742742 let metrics = Arc :: new ( Metrics :: default ( ) ) ;
743743 let peers = Arc :: new ( Registry :: new ( ) ) ;
744744 let routes = RouteTable :: shared ( ) ;
@@ -754,7 +754,7 @@ mod tests {
754754 tokio:: sync:: broadcast:: channel ( 16 ) . 0 ,
755755 ) ;
756756
757- let status = crate :: node_api:: NodeApi :: status ( & handler) ;
757+ let status = crate :: node_api:: NodeApi :: info ( & handler) ;
758758 assert_eq ! ( status. role, NodeRole :: Indeterminate ) ;
759759 }
760760
@@ -795,7 +795,7 @@ mod tests {
795795 }
796796
797797 #[ test]
798- fn test_status_reflects_node_state_updates ( ) {
798+ fn test_info_reflects_node_state_updates ( ) {
799799 let handler = Handler :: new (
800800 HandlerConfig :: new (
801801 NodeRole :: Indeterminate ,
@@ -809,7 +809,7 @@ mod tests {
809809 ) ;
810810
811811 // Initially indeterminate with no capabilities.
812- let status = crate :: node_api:: NodeApi :: status ( & handler) ;
812+ let status = crate :: node_api:: NodeApi :: info ( & handler) ;
813813 assert_eq ! ( status. role, NodeRole :: Indeterminate ) ;
814814 assert ! ( !status. capabilities. tun_capable) ;
815815 assert ! ( !status. capabilities. listening) ;
@@ -825,15 +825,15 @@ mod tests {
825825 interactive : false ,
826826 } ) ;
827827
828- let status = crate :: node_api:: NodeApi :: status ( & handler) ;
828+ let status = crate :: node_api:: NodeApi :: info ( & handler) ;
829829 assert_eq ! ( status. role, NodeRole :: Entry ) ;
830830 assert ! ( status. capabilities. tun_capable) ;
831831
832832 // Simulate listen address being set.
833833 let addr: SocketAddr = "0.0.0.0:4433" . parse ( ) . unwrap ( ) ;
834834 state. set_listen_addr ( addr) ;
835835
836- let status = crate :: node_api:: NodeApi :: status ( & handler) ;
836+ let status = crate :: node_api:: NodeApi :: info ( & handler) ;
837837 assert_eq ! ( status. listen_addr, Some ( addr) ) ;
838838 assert ! ( status. capabilities. listening) ;
839839 }
0 commit comments