Add an arc from your node to the "error-drop" node, set next0 = 
MYNODE_NEXT_ERROR and b0->error = node->errors[SOME_ERROR].

Please use the standard dual/single - or quad/single - loop code pattern to 
walk the incoming vector of buffer indices. You will hate your life if you try 
to code the vector-walk from first principles. It's not impossible, but I it 
will be a waste of your time / a bunch of needless aggravation.

b0->sw_if_index[VLIB_TX] is interpreted in a couple of different ways. 
"ip4/6-lookup" interprets it as a fib index. "interface-output" interprets it 
as a [tx] hardware interface ID.

I'm not sure what you're trying to do, but if it involves an ip lookup, do NOT 
set b0->sw_if_index[VLIB_TX]. Let the fib code do its job, and send pkts to 
either the input nodes - if mandatory input checks / ttl decrement have not 
been performed - or to the lookup stage if e.g. you've rewritten the ip 
header(s) in some fashion.

HTH... Dave

-----Original Message-----
From: <> On Behalf Of Avi Cohen (A)
Sent: Wednesday, March 7, 2018 6:38 AM
Subject: [vpp-dev] VPP - mechanism to drop packets

I'm implementing a simple policy plugin , below is the pseudo-code 

Go over the packets vector
While (there are packets to process )
Check if a packet match a specific rule
  If yes - set the out-interface for the packet to be transmitted
  Else - drop packet

2 Question -
1. is there  any function/mechanism that implements a drop ? or any filed in 
the packet's metadata for drop marking ?
2. Regarding the set tx out interface - I see that I can set the 
sw_if_index[VLIB_TX] - so the packet will be later transmitted through this 
interface - is this correct ? 

Best Regards


You receive all messages sent to this group.

View/Reply Online (#8447):
View All Messages In Topic (2):
Mute This Topic:
New Topic:

Change Your Subscription:
Group Home:
Contact Group Owner:
Terms of Service:

Reply via email to