@@ -112,8 +112,52 @@ pub enum AsicError {
112112 Missing ( String ) ,
113113}
114114
115- /// The `AsicOps ` trait contains all of the non-Table related ASIC operations
115+ /// The `AsicMulticastOps ` trait contains the multicast- related ASIC operations
116116/// that the dataplane daemon requires.
117+ #[ cfg( feature = "multicast" ) ]
118+ pub trait AsicMulticastOps {
119+ /// Return a vector containing all of the defined multicast groups.
120+ fn mc_domains ( & self ) -> Vec < u16 > ;
121+
122+ /// For a given multicast group, return the number of ports assigned to it.
123+ fn mc_port_count ( & self , group_id : u16 ) -> AsicResult < usize > ;
124+
125+ /// Add a port to a multicast group. The port is identified using its ASIC
126+ /// identifier.
127+ fn mc_port_add (
128+ & self ,
129+ group_id : u16 ,
130+ port : AsicId ,
131+ rid : u16 ,
132+ level_1_excl_id : u16 ,
133+ ) -> AsicResult < ( ) > ;
134+
135+ /// Remove a port from a multicast group. The port is identified using its ASIC
136+ /// identifier.
137+ fn mc_port_remove ( & self , group_id : u16 , port : AsicId ) -> AsicResult < ( ) > ;
138+
139+ /// Create a new, unpopulated multicast group.
140+ fn mc_group_create ( & self , group_id : u16 ) -> AsicResult < ( ) > ;
141+
142+ /// Destroy a multicast group.
143+ fn mc_group_destroy ( & self , group_id : u16 ) -> AsicResult < ( ) > ;
144+
145+ /// Check if a multicast group exists.
146+ fn mc_group_exists ( & self , group_id : u16 ) -> bool {
147+ self . mc_domains ( ) . contains ( & group_id)
148+ }
149+
150+ /// Get the total number of multicast groups.
151+ fn mc_groups_count ( & self ) -> AsicResult < usize > ;
152+
153+ /// Set the maximum number of multicast nodes.
154+ fn mc_set_max_nodes (
155+ & self ,
156+ max_nodes : u32 ,
157+ max_link_aggregated_nodes : u32 ,
158+ ) -> AsicResult < ( ) > ;
159+ }
160+
117161pub trait AsicOps {
118162 /// Reports the kind of media plugged into the port
119163 // TODO-correctness: This should probably take a `PortId` or `Connector`.
@@ -196,47 +240,6 @@ pub trait AsicOps {
196240 connector : Connector ,
197241 ) -> AsicResult < Vec < u8 > > ;
198242
199- /// Return a vector containing all of the defined multicast groups.
200- fn mc_domains ( & self ) -> Vec < u16 > ;
201-
202- /// For a given multicast group, return the number of ports assigned to it.
203- fn mc_port_count ( & self , group_id : u16 ) -> AsicResult < usize > ;
204-
205- /// Add a port to a multicast group. The port is identified using its ASIC
206- /// identifier.
207- fn mc_port_add (
208- & self ,
209- group_id : u16 ,
210- port : AsicId ,
211- rid : u16 ,
212- level_1_excl_id : u16 ,
213- ) -> AsicResult < ( ) > ;
214-
215- /// Remove a port from a multicast group. The port is identified using its ASIC
216- /// identifier.
217- fn mc_port_remove ( & self , group_id : u16 , port : AsicId ) -> AsicResult < ( ) > ;
218-
219- /// Create a new, unpopulated multicast group.
220- fn mc_group_create ( & self , group_id : u16 ) -> AsicResult < ( ) > ;
221-
222- /// Destroy a multicast group.
223- fn mc_group_destroy ( & self , group_id : u16 ) -> AsicResult < ( ) > ;
224-
225- /// Check if a multicast group exists.
226- fn mc_group_exists ( & self , group_id : u16 ) -> bool {
227- self . mc_domains ( ) . contains ( & group_id)
228- }
229-
230- /// Get the total number of multicast groups.
231- fn mc_groups_count ( & self ) -> AsicResult < usize > ;
232-
233- /// Set the maximum number of multicast nodes.
234- fn mc_set_max_nodes (
235- & self ,
236- max_nodes : u32 ,
237- max_link_aggregated_nodes : u32 ,
238- ) -> AsicResult < ( ) > ;
239-
240243 /// Get sidecar identifiers of the device being managed.
241244 fn get_sidecar_identifiers ( & self ) -> AsicResult < impl SidecarIdentifiers > ;
242245
0 commit comments