@@ -589,13 +589,27 @@ def dpstr(self, more=False):
589
589
print_str += "userdata="
590
590
for f in self .get_attr ("OVS_USERSPACE_ATTR_USERDATA" ):
591
591
print_str += "%x." % f
592
- if self .get_attr ("OVS_USERSPACE_ATTR_TUN_PORT " ) is not None :
592
+ if self .get_attr ("OVS_USERSPACE_ATTR_EGRESS_TUN_PORT " ) is not None :
593
593
print_str += "egress_tun_port=%d" % self .get_attr (
594
- "OVS_USERSPACE_ATTR_TUN_PORT "
594
+ "OVS_USERSPACE_ATTR_EGRESS_TUN_PORT "
595
595
)
596
596
print_str += ")"
597
597
return print_str
598
598
599
+ def parse (self , actstr ):
600
+ attrs_desc = (
601
+ ("pid" , "OVS_USERSPACE_ATTR_PID" , int ),
602
+ ("userdata" , "OVS_USERSPACE_ATTR_USERDATA" ,
603
+ lambda x : list (bytearray .fromhex (x ))),
604
+ ("egress_tun_port" , "OVS_USERSPACE_ATTR_EGRESS_TUN_PORT" , int )
605
+ )
606
+
607
+ attrs , actstr = parse_attrs (actstr , attrs_desc )
608
+ for attr in attrs :
609
+ self ["attrs" ].append (attr )
610
+
611
+ return actstr
612
+
599
613
def dpstr (self , more = False ):
600
614
print_str = ""
601
615
@@ -843,6 +857,12 @@ def parse(self, actstr):
843
857
self ["attrs" ].append (["OVS_ACTION_ATTR_PSAMPLE" , psampleact ])
844
858
parsed = True
845
859
860
+ elif parse_starts_block (actstr , "userspace(" , False ):
861
+ uact = self .userspace ()
862
+ actstr = uact .parse (actstr [len ("userspace(" ) : ])
863
+ self ["attrs" ].append (["OVS_ACTION_ATTR_USERSPACE" , uact ])
864
+ parsed = True
865
+
846
866
actstr = actstr [strspn (actstr , ", " ) :]
847
867
while parencount > 0 :
848
868
parencount -= 1
0 commit comments