summaryrefslogtreecommitdiffstats
path: root/vpp-api/python/pneum/pneum.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-08-01 04:59:13 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-08-25 00:29:40 +0000
commit5f9dcff39d5e25c6bef30d569e405635633f3c69 (patch)
treeec14d5fdb45a9d82cf5703d63e0bcafcc40d4da0 /vpp-api/python/pneum/pneum.c
parent151fb725636f192da8a04d0f74dc3455b58dd61c (diff)
VPP Python language binding - plugin support
- Moved Python generator tool to tools directory - Added build-vpp-api Makefile target - Generator now only creates a Python representation of the .api the rest of the framework is in the vpp_papi script - Each plugin has its own namespace. - Plugin Python files are installed in vpp_papi_plugins for easy use inside the build tree. Change-Id: I272c83bb7e5d5e416bdbd8a790a3cc35c5a04e38 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vpp-api/python/pneum/pneum.c')
-rw-r--r--vpp-api/python/pneum/pneum.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/vpp-api/python/pneum/pneum.c b/vpp-api/python/pneum/pneum.c
index ac518493163..2637d43f5d9 100644
--- a/vpp-api/python/pneum/pneum.c
+++ b/vpp-api/python/pneum/pneum.c
@@ -10,7 +10,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
*/
#include <stdio.h>
#include <stdlib.h>
@@ -36,11 +36,11 @@
#include "pneum.h"
#define vl_typedefs /* define message structures */
-#include <vpp-api/vpe_all_api_h.h>
+#include <vpp-api/vpe_all_api_h.h>
#undef vl_typedefs
#define vl_endianfun /* define message structures */
-#include <vpp-api/vpe_all_api_h.h>
+#include <vpp-api/vpe_all_api_h.h>
#undef vl_endianfun
typedef struct {
@@ -54,12 +54,12 @@ pneum_main_t pneum_main;
extern int wrap_pneum_callback(char *data, int len);
-/*
+/*
* Satisfy external references when -lvlib is not available.
*/
void vlib_cli_output (struct vlib_main_t * vm, char * fmt, ...)
{
- clib_warning ("vlib_cli_output callled...");
+ clib_warning ("vlib_cli_output called...");
}
#define vl_api_version(n,v) static u32 vpe_api_version = v;
@@ -89,7 +89,7 @@ pneum_api_handler (void *msg)
int l = ntohl(msgbuf->data_len);
if (l == 0)
clib_warning("Message ID %d has wrong length: %d\n", id, l);
-
+
/* Call Python callback */
(void)wrap_pneum_callback(msg, l);
vl_msg_api_free(msg);
@@ -121,12 +121,6 @@ pneum_connect (char *name)
int rv = 0;
pneum_main_t *pm = &pneum_main;
- /*
- * Bail out now if we're not running as root
- */
- if (geteuid() != 0)
- return (-1);
-
if ((rv = vl_client_api_map("/vpe-api"))) {
clib_warning ("vl_client_api map rv %d", rv);
return rv;
@@ -199,7 +193,7 @@ pneum_read (char **p, int *l)
*p = (char *)msg;
} else {
printf("Read failed with %d\n", rv);
- }
+ }
return (rv);
}