X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Finterface_format.c;fp=src%2Fvnet%2Finterface_format.c;h=507e2676ccb2976810de558e7febe2295c0b9b6a;hb=9485d99bd3941b13abf7e47fc7e1d56f7b4fee55;hp=69f481c303d13a29206f9e1ef99146e2263c90ab;hpb=592a909a302262cf4088a5468b8e427f577725e8;p=vpp.git diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c index 69f481c303d..507e2676ccb 100644 --- a/src/vnet/interface_format.c +++ b/src/vnet/interface_format.c @@ -41,6 +41,42 @@ #include #include #include +#include + +u8 * +format_vtr (u8 * s, va_list * args) +{ + u32 vtr_op = va_arg (*args, u32); + u32 dot1q = va_arg (*args, u32); + u32 tag1 = va_arg (*args, u32); + u32 tag2 = va_arg (*args, u32); + switch (vtr_op) + { + case L2_VTR_DISABLED: + return format (s, "none"); + case L2_VTR_PUSH_1: + return format (s, "push-1 %s %d", dot1q ? "dot1q" : "dot1ad", tag1); + case L2_VTR_PUSH_2: + return format (s, "push-2 %s %d %d", dot1q ? "dot1q" : "dot1ad", tag1, + tag2); + case L2_VTR_POP_1: + return format (s, "pop-1"); + case L2_VTR_POP_2: + return format (s, "pop-2"); + case L2_VTR_TRANSLATE_1_1: + return format (s, "trans-1-1 %s %d", dot1q ? "dot1q" : "dot1ad", tag1); + case L2_VTR_TRANSLATE_1_2: + return format (s, "trans-1-2 %s %d %d", dot1q ? "dot1q" : "dot1ad", + tag1, tag2); + case L2_VTR_TRANSLATE_2_1: + return format (s, "trans-2-1 %s %d", dot1q ? "dot1q" : "dot1ad", tag1); + case L2_VTR_TRANSLATE_2_2: + return format (s, "trans-2-2 %s %d %d", dot1q ? "dot1q" : "dot1ad", + tag1, tag2); + default: + return format (s, "none"); + } +} u8 * format_vnet_sw_interface_flags (u8 * s, va_list * args)