Jon Loeliger | c0b1954 | 2020-05-11 08:43:51 -0500 | [diff] [blame] | 1 | /* Hey Emacs use -*- mode: C -*- */ |
| 2 | /* |
| 3 | * Copyright 2020 Rubicon Communications, LLC. |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at: |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | option version = "1.0.0"; |
| 19 | |
| 20 | |
| 21 | enum node_flag : u32 |
| 22 | { |
| 23 | NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH = 0x0001, |
| 24 | NODE_FLAG_IS_OUTPUT = 0x0002, |
| 25 | NODE_FLAG_IS_DROP = 0x0004, |
| 26 | NODE_FLAG_IS_PUNT = 0x0008, |
| 27 | NODE_FLAG_IS_HANDOFF = 0x0010, |
| 28 | NODE_FLAG_TRACE = 0x0020, |
| 29 | NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE=0x0040, |
| 30 | NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE=0x0080, |
| 31 | NODE_FLAG_TRACE_SUPPORTED = 0x0100, |
| 32 | }; |
| 33 | |
| 34 | |
| 35 | service { |
| 36 | rpc graph_node_get returns graph_node_get_reply |
| 37 | stream graph_node_details; |
| 38 | }; |
| 39 | |
| 40 | /** \brief graph_node_get - Get nodes of the packet processing graph |
| 41 | In order: |
| 42 | if index != ~0, dump node with given index |
| 43 | if index == ~0 and name[0] != 0, dump named node |
| 44 | if index == ~0 and name[0] == 0 and flag != 0, dump flagged nodes |
| 45 | otherwise when no selection criteria given, dump all nodes. |
| 46 | @param client_index - opaque cookie to identify the sender |
| 47 | @param context - sender context, to match reply w/ request |
| 48 | @param cursor - Starting iterator value, ~0 for initial request |
| 49 | @param index - index of a specific node, or ~0 for all |
| 50 | @param name - name of a specific node, or 0 for all |
| 51 | @param flags - NODE_FLAG_* values |
| 52 | @param flags - If true, dump details will contain next nodes out-arcs |
| 53 | */ |
| 54 | define graph_node_get |
| 55 | { |
| 56 | u32 client_index; |
| 57 | u32 context; |
| 58 | u32 cursor; |
| 59 | u32 index; |
| 60 | string name[64]; /* GRAPH_NODE_LEN */ |
| 61 | vl_api_node_flag_t flags; /* NODE_FLAG_* bits */ |
| 62 | bool want_arcs; /* Include node out-arcs? */ |
| 63 | option vat_help = "graph_node_dump [start <cursor>] [node_index <index>]|[node_name <name>]|[flags]"; |
| 64 | }; |
| 65 | |
| 66 | define graph_node_get_reply |
| 67 | { |
| 68 | u32 context; |
| 69 | i32 retval; |
| 70 | u32 cursor; |
| 71 | }; |
| 72 | |
| 73 | /** \brief Details for each graph node |
| 74 | @param index - index of the node |
| 75 | @param name - name of the node |
| 76 | @param flags - NODE_FLAG_* values |
| 77 | @param n_arcs - If requested, the number of out-arcs to other nodes |
| 78 | @param arcs - If requested, the set of out-arc next-node-indices |
| 79 | */ |
| 80 | define graph_node_details |
| 81 | { |
| 82 | u32 context; |
| 83 | u32 index; |
| 84 | string name[64]; /* GRAPH_NODE_LEN */ |
| 85 | vl_api_node_flag_t flags; |
| 86 | u32 n_arcs; |
| 87 | u32 arcs_out[n_arcs]; |
| 88 | }; |
| 89 | |
| 90 | |
| 91 | /* |
| 92 | * Local Variables: |
| 93 | * eval: (c-set-style "gnu") |
| 94 | * End: |
| 95 | */ |