3 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 local vpp = require "vpp-lapi"
20 local bit = require("bit")
22 root_dir = "/home/ubuntu/vpp"
23 pneum_path = root_dir .. "/build-root/install-vpp_debug-native/vpp-api/lib64/libpneum.so"
26 vpp:init({ pneum_path = pneum_path })
28 vpp:json_api(root_dir .. "/build-root/install-vpp_debug-native/vpp/vpp-api/vpe.api.json")
34 print("Calling API to add a new classifier table")
35 reply = vpp:api_call("classify_add_del_table", {
37 memory_size = bit.lshift(2, 20),
44 mask = "\255\255\255\255\255\255\255\255" .. "\255\255\255\255\255\255\255\255"
46 print(vpp.dump(reply))