Re: [vpp-dev] Up to date documentation for working with vpp_api 2.0.0?

2022-07-12 Thread Dave Houser
@Pim,

Thank you! I saw the VPPApiClient Class, just didn't know how to use it. Your 
example should give me good direction going forward.

- Dave

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21646): https://lists.fd.io/g/vpp-dev/message/21646
Mute This Topic: https://lists.fd.io/mt/92332743/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] Up to date documentation for working with vpp_api 2.0.0?

2022-07-12 Thread Pim van Pelt
Hi Dave,

That documentation is out of date, and the class is VPPApiClient. Here's a
quick demo script for you:

from vpp_papi import VPPApiClient

from vpp_papi import VppEnum

import os

import fnmatch

import sys


vpp_json_dir = '/usr/share/vpp/api/'


# construct a list of all the json api files

jsonfiles = []

for root, dirnames, filenames in os.walk(vpp_json_dir):

  for filename in fnmatch.filter(filenames, '*.api.json'):

jsonfiles.append(os.path.join(root, filename))


vpp = VPPApiClient(apifiles=jsonfiles, server_address='/run/vpp/api.sock')

vpp.connect("test-client")


r = vpp.api.show_version()

print('VPP version is %s' % r.version)


iface_list = vpp.api.sw_interface_dump()

for iface in iface_list:

  print(iface)

  if iface.link_duplex ==
VppEnum.vl_api_link_duplex_t.LINK_DUPLEX_API_UNKNOWN:

## Do something with this match

pass

To your other question, vppctl is the debug CLI. You cannot issue API calls
with that tool. Take a look at *vat2*, which can send an API message to VPP
and print its reply, or use the generated API client *vpp_api_test.*

Hope that helps, groet,
Pim

On Tue, Jul 12, 2022 at 3:26 PM Dave Houser  wrote:

> Hello,
>
> I am new to working with the vpp-api. I tried reading the documentation
> found here , however I am unable
> import "VPP" from "vpp_papi". Looking at the source for
> "/usr/lib/python3/dist-packages/vpp_papi/vpp_papi.py", there is no class
> called "VPP".
>
> I am a total newb working with vpp-api, can someone point me in the right
> direction on how I can get started? Main goal is to create an ACL, add
> ACE's, change them, and remove them.
>
> Any help would be appreciated, thanks!
>
> - Dave
>
> 
>
>

-- 
Pim van Pelt 
PBVP1-RIPE - http://www.ipng.nl/

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21645): https://lists.fd.io/g/vpp-dev/message/21645
Mute This Topic: https://lists.fd.io/mt/92332743/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] Up to date documentation for working with vpp_api 2.0.0?

2022-07-12 Thread Dave Houser
Also "acl_add_replace" does not work directly from vppctl

```

sudo vppctl acl_add_replace ?

unknown input `acl_add_replace ?'

```

However when I am in VAT I can run the command. Am I missing a module in VPP?

```
$ sudo vppctl show plugin
Plugin path is: /usr/lib/x86_64-linux-gnu/vpp_plugins

Plugin                                   Version                          
Description
1. ioam_plugin.so                           22.10-rc0~60-g55050c31c          
Inbound Operations, Administration, and Maintenance (OAM)
2. lldp_plugin.so                           22.10-rc0~60-g55050c31c          
Link Layer Discovery Protocol (LLDP)
3. urpf_plugin.so                           22.10-rc0~60-g55050c31c          
Unicast Reverse Path Forwarding (uRPF)
4. http_static_plugin.so                    22.10-rc0~60-g55050c31c          
HTTP Static Server
5. l3xc_plugin.so                           22.10-rc0~60-g55050c31c          L3 
Cross-Connect (L3XC)
6. mdata_plugin.so                          22.10-rc0~60-g55050c31c          
Buffer metadata change tracker.
7. ping_plugin.so                           22.10-rc0~60-g55050c31c          
Ping (ping)
8. tlsopenssl_plugin.so                     22.10-rc0~60-g55050c31c          
Transport Layer Security (TLS) Engine, OpenSSL Based
9. avf_plugin.so                            22.10-rc0~60-g55050c31c          
Intel Adaptive Virtual Function (AVF) Device Driver
10. l2tp_plugin.so                           22.10-rc0~60-g55050c31c          
Layer 2 Tunneling Protocol v3 (L2TP)
11. pppoe_plugin.so                          22.10-rc0~60-g55050c31c          
PPP over Ethernet (PPPoE)
12. pnat_plugin.so                           22.10-rc0~60-g55050c31c          
Policy 1:1 NAT
13. srv6am_plugin.so                         22.10-rc0~60-g55050c31c          
Masquerading Segment Routing for IPv6 (SRv6) Proxy
14. crypto_native_plugin.so                  22.10-rc0~60-g55050c31c          
Intel IA32 Software Crypto Engine
15. flowprobe_plugin.so                      22.10-rc0~60-g55050c31c          
Flow per Packet
16. dpdk_plugin.so                           22.10-rc0~60-g55050c31c          
Data Plane Development Kit (DPDK)
17. det44_plugin.so                          22.10-rc0~60-g55050c31c          
Deterministic NAT (CGN)
18. hs_apps_plugin.so                        22.10-rc0~60-g55050c31c          
Host Stack Applications
19. adl_plugin.so                            22.10-rc0~60-g55050c31c          
Allow/deny list plugin
20. acl_plugin.so                            22.10-rc0~60-g55050c31c          
Access Control Lists (ACL)
21. hsi_plugin.so                            22.10-rc0~60-g55050c31c          
Host Stack Intercept (HSI)
22. crypto_openssl_plugin.so                 22.10-rc0~60-g55050c31c          
OpenSSL Crypto Engine
23. dslite_plugin.so                         22.10-rc0~60-g55050c31c          
Dual-Stack Lite
24. ikev2_plugin.so                          22.10-rc0~60-g55050c31c          
Internet Key Exchange (IKEv2) Protocol
25. svs_plugin.so                            22.10-rc0~60-g55050c31c          
Source Virtual Routing and Forwarding (VRF) Select
26. vrrp_plugin.so                           22.10-rc0~60-g55050c31c          
VRRP v3 (RFC 5798)
27. tracedump_plugin.so                      22.10-rc0~60-g55050c31c          
Streaming packet trace dump plugin
28. nsim_plugin.so                           22.10-rc0~60-g55050c31c          
Network Delay Simulator
29. dns_plugin.so                            22.10-rc0~60-g55050c31c          
Simple DNS name resolver
30. mss_clamp_plugin.so                      22.10-rc0~60-g55050c31c          
TCP MSS clamping plugin
31. builtinurl_plugin.so                     22.10-rc0~60-g55050c31c          
vpp built-in URL support
32. cnat_plugin.so                           22.10-rc0~60-g55050c31c          
CNat Translate
33. perfmon_plugin.so                        22.10-rc0~60-g55050c31c          
Performance Monitor
34. dhcp_plugin.so                           22.10-rc0~60-g55050c31c          
Dynamic Host Configuration Protocol (DHCP)
35. rdma_plugin.so                           22.10-rc0~60-g55050c31c          
RDMA IBverbs Device Driver
36. vmxnet3_plugin.so                        22.10-rc0~60-g55050c31c          
VMWare Vmxnet3 Device Driver
37. wireguard_plugin.so                      22.10-rc0~60-g55050c31c          
Wireguard Protocol
38. igmp_plugin.so                           22.10-rc0~60-g55050c31c          
Internet Group Management Protocol (IGMP)
39. nat_plugin.so                            22.10-rc0~60-g55050c31c          
Network Address Translation (NAT)
40. tlsmbedtls_plugin.so                     22.10-rc0~60-g55050c31c          
Transport Layer Security (TLS) Engine, Mbedtls Based
41. memif_plugin.so                          22.10-rc0~60-g55050c31c          
Packet Memory Interface (memif) -- Experimental
42. crypto_ipsecmb_plugin.so                 22.10-rc0~60-g55050c31c          
Intel IPSEC Multi-buffer Crypt

[vpp-dev] Up to date documentation for working with vpp_api 2.0.0?

2022-07-12 Thread Dave Houser
Hello,

I am new to working with the vpp-api. I tried reading the documentation found 
here ( https://wiki.fd.io/view/VPP/Python_API ) , however I am unable import 
"VPP" from "vpp_papi". Looking at the source for 
"/usr/lib/python3/dist-packages/vpp_papi/vpp_papi.py", there is no class called 
"VPP".

I am a total newb working with vpp-api, can someone point me in the right 
direction on how I can get started? Main goal is to create an ACL, add ACE's, 
change them, and remove them.

Any help would be appreciated, thanks!

- Dave

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21643): https://lists.fd.io/g/vpp-dev/message/21643
Mute This Topic: https://lists.fd.io/mt/92332743/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[vpp-dev] The position of ipsec4-output-feature in the arc ip4-output

2022-07-12 Thread Guangming

Hi All,
 When I test VPP ipsec with version 2110, I found the  node 
ipsec4-output-feature is the last node in ARC ip4-output. So when use SPD in 
ipsec. if there is 
big packet that was fragment when output . When the fragment packet was input 
ipsec4-output-feature node. the other packet expect the first fragment 
packet will not match SPD policy ,so the packet was droped.  


00:12:05:665867: ip4-lookup
  fib 0 dpo-idx 7 flow hash: 0x
  UDP: 10.10.10.15 -> 10.10.10.2
tos 0x00, ttl 128, length 1548, checksum 0x0cbd dscp CS0 ecn NON_ECN
fragment id 0x
  UDP: 500 -> 500
length 1528, checksum 0x94f4
00:12:05:665868: ip4-rewrite
  tx_sw_if_index 0 dpo-idx 7 : ipv4 via 10.10.10.2 GigabitEthernet0/13/0: 
mtu:1500 next:4 flags:[features ] ee9d5c8281695e0001010800 flow hash: 
0x05dc
  : 4500060c80110cbd0a0a0a0f0a0a0a0201f401f405f894f43eb4a54c
  0020: 65ce89de80feb8853ee4fe402e20232105f0240005d4
00:12:05:665869: ip4-frag
  IPv4 mtu: 1500 fragments: 2 next: 0
00:12:05:665878: ip4-rewrite
  tx_sw_if_index 1 dpo-idx 7 : ipv4 via 10.10.10.2 GigabitEthernet0/13/0: 
mtu:1500 next:4 flags:[features ] ee9d5c8281695e0001010800 flow hash: 
0x
  : ee9d5c8281695e0001010800450005dc060020007f11e7ec0a0a0a0f0a0a
  0020: 0a0201f401f405f894f43eb4a54c65ce89de80feb8853ee4fe402e20
  tx_sw_if_index 1 dpo-idx 7 : ipv4 via 10.10.10.2 GigabitEthernet0/13/0: 
mtu:1500 next:4 flags:[features ] ee9d5c8281695e0001010800 flow hash: 
0x
  : ee9d5c8281695e0001010800454406b97f110ccc0a0a0a0f0a0a
  0020: 0a02cb4be59b66a472db88e5a88133f298724b594b7624391727117e
00:12:05:665880: ipsec4-output-feature
  spd 2 policy 17
  spd 2 policy -1
00:12:05:665882: error-drop
  rx:local0
00:12:05:665883: GigabitEthernet0/13/0-output
  GigabitEthernet0/13/0 
  IP4: 00:00:5e:00:01:01 -> ee:9d:5c:82:81:69
  UDP: 10.10.10.15 -> 10.10.10.2
tos 0x00, ttl 127, length 1500, checksum 0xe7ec dscp CS0 ecn NON_ECN
fragment id 0x0600, flags MORE_FRAGMENTS
  UDP: 500 -> 500
length 1528, checksum 0x94f4
00:12:05:665884: drop
  ip4-frag: packet fragmented
00:12:05:665884: GigabitEthernet0/13/0-tx
  GigabitEthernet0/13/0 tx queue 0
  buffer 0x91ca7: current data -14, length 1514, buffer-pool 0, ref-count 1, 
trace handle 0x6
  ip4 l3-hdr-offset 0 
  PKT MBUF: port 65535, nb_segs 1, pkt_len 1514
buf_len 2176, data_len 1514, ol_flags 0x0, data_off 114, phys_addr 
0x62272a40
packet_type 0x0 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0 
rss 0x0 fdir.hi 0x0 fdir.lo 0x0
  IP4: 00:00:5e:00:01:01 -> ee:9d:5c:82:81:69
  UDP: 10.10.10.15 -> 10.10.10.2
tos 0x00, ttl 127, length 1500, checksum 0xe7ec dscp CS0 ecn NON_ECN
fragment id 0x0600, flags MORE_FRAGMENTS
  UDP: 500 -> 500
length 1528, checksum 0x94f4



Can we move the node ipsec4-output-feature to the first node in ARC   
ip4-output ? And any bad effect when move this node position? 

Thanks
 Guangming



zhangguangm...@baicells.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21642): https://lists.fd.io/g/vpp-dev/message/21642
Mute This Topic: https://lists.fd.io/mt/92328476/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-