2 * Copyright (c) 2018 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef VPP_JVPP_CORE_H
17 #define VPP_JVPP_CORE_H
19 #include <vlibapi/api_types.h>
21 #endif //VPP_JVPP_CORE_H
24 // * Host to network byte order conversion for string type. Converts String in Java to VPP string type.
29 // * } __attribute__ ((packed)) vl_api_string_t;
31 static void _host_to_net_string(JNIEnv * env, jstring javaString, vl_api_string_t * vl_api_string);
36 // * Network to host byte order conversion for string type. Converts VPP string type to String in Java
41 // * } __attribute__ ((packed)) vl_api_string_t;
43 static jstring _net_to_host_string(JNIEnv * env, const vl_api_string_t * _net);
48 // * Returns the length of jstring as size_t
50 static size_t jstr_length(JNIEnv *env, jstring string);