@@ -347,6 +347,28 @@ public void removeRxQueue(int portIndex) {
347347 callMethod ("set_rx_feature" , payload );
348348 }
349349
350+ /** Set promiscuous mode, Enable interface to receive packets from all mac addresses */
351+ public void setPromiscuousMode (int portIndex , boolean enabled ) {
352+ Map <String , Object > payload = createPayload (portIndex );
353+ Map <String , Object > attributes = new HashMap <>();
354+ Map <String , Object > promiscuousValue = new HashMap <>();
355+ promiscuousValue .put ("enabled" , enabled );
356+ attributes .put ("promiscuous" , promiscuousValue );
357+ payload .put ("attr" , attributes );
358+ callMethod ("set_port_attr" , payload );
359+ }
360+
361+ /** Set flow control mode, Flow control: 0 = none, 1 = tx, 2 = rx, 3 = full */
362+ public void setFlowControlMode (int portIndex , int mode ) {
363+ Map <String , Object > payload = createPayload (portIndex );
364+ Map <String , Object > attributes = new HashMap <>();
365+ Map <String , Object > flowCtrlValue = new HashMap <>();
366+ flowCtrlValue .put ("enabled" , mode );
367+ attributes .put ("flow_ctrl_mode" , flowCtrlValue );
368+ payload .put ("attr" , attributes );
369+ callMethod ("set_port_attr" , payload );
370+ }
371+
350372 public synchronized void sendPacket (int portIndex , Packet pkt ) {
351373 Stream stream = build1PktSingleBurstStream (pkt );
352374
0 commit comments