18 #define vl_api_version(n,v) static u32 vpe_api_version = (v); 19 #include <api/vpe.api.h> 26 #include <japi/org_openvpp_vppjapi_vppConn.h> 27 #include <japi/org_openvpp_vppjapi_vppApi.h> 39 #define vl_print(handle, ...) 44 #define VPPJNI_DEBUG 0 47 #define DEBUG_LOG(...) clib_warning(__VA_ARGS__) 49 #define DEBUG_LOG(...) 60 void __stack_chk_guard (
void) __attribute__((weak));
61 void __stack_chk_guard (
void) { }
72 BIND_JAPI_OBJ_FIELD(vppBridgeDomainDetails, interfaces,
"[Lorg/openvpp/vppjapi/vppBridgeDomainInterfaceDetails;");
79 BIND_JAPI_CLASS(vppInterfaceDetails,
"(ILjava/lang/String;I[BBBBBIBBIIBBBBIIIII)V");
83 BIND_JAPI_CLASS(vppVersion,
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
92 mp->
api_versions[0] = clib_host_to_net_u32 (vpe_api_version);
107 vec_add2 (nses, ns, 1);
108 ns->name = (u8 *)(p->key);
109 ns->value = (u32) p->value[0];
161 strncpy ((
char *) mp->
name_filter,
"l2tpv3_tunnel",
168 M(CONTROL_PING, control_ping);
175 (JNIEnv *env, jobject obj)
180 jstring progName = (*env)->NewStringUTF(env, (
char *)jm->
program_name);
181 jstring buildDir = (*env)->NewStringUTF(env, (
char *)jm->
build_directory);
182 jstring version = (*env)->NewStringUTF(env, (
char *)jm->
version);
183 jstring buildDate = (*env)->NewStringUTF(env, (
char *)jm->
build_date);
186 return vppVersionObject(env, progName, buildDir, version, buildDate);
196 M(SHOW_VERSION, show_version);
212 M(WANT_STATS, want_stats);
221 if (rv == -2 || rv == -3)
227 (JNIEnv *env, jobject obj, jstring ifName, jstring ifDesc)
232 u32 sw_if_index = ~0;
235 const char *if_name_str = (*env)->GetStringUTFChars (env, ifName, 0);
236 const char *if_desc_str = (*env)->GetStringUTFChars (env, ifDesc, 0);
245 sw_if_index = (jint) p[0];
249 (*env)->ReleaseStringUTFChars (env, ifDesc, if_desc_str);
264 (*env)->ReleaseStringUTFChars (env, ifName, if_name_str);
270 (JNIEnv * env, jobject obj, jstring ifName)
273 u32 sw_if_index = ~0;
275 jstring ifDesc =
NULL;
276 const char *if_name_str = (*env)->GetStringUTFChars (env, ifName, 0);
285 sw_if_index = (jint) p[0];
293 ifDesc = (*env)->NewStringUTF(env, (
char *)s);
302 (JNIEnv *env, jobject obj, jstring clientName)
305 const char *client_name;
306 void vl_msg_reply_handler_hookup(
void);
322 client_name = (*env)->GetStringUTFChars(env, clientName, 0);
339 (*env)->ReleaseStringUTFChars (env, clientName, client_name);
342 vl_msg_reply_handler_hookup ();
360 M(CONTROL_PING, control_ping);
370 clib_warning (
"unable to retrieve vpp version (rv: %d)", rv);
373 clib_warning (
"unable to retrieve interface list (rv: %d)", rv);
376 clib_warning (
"unable to subscribe to stats (rv: %d)", rv);
378 DEBUG_LOG (
"clientConnect result: %d", rv);
384 (JNIEnv *env, jobject obj)
390 save_heap = jm->
heap;
391 memset (jm, 0,
sizeof (*jm));
392 jm->
heap = save_heap;
398 u16 msg_id = clib_net_to_host_u16 (mp->_vl_msg_id);
400 i32 retval = clib_net_to_host_u32 (mp->retval);
401 int total_bytes =
sizeof(mp);
403 u8 * saved_reply = 0;
404 u32 context = clib_host_to_net_u32 (mp->context);
409 clib_warning (
"msg id %d: no trace configuration\n", msg_id);
411 total_bytes = cfgp->
size;
415 DEBUG_LOG (
"Received generic reply for msg id %d", msg_id);
418 if (retval >= 0 && total_bytes ==
sizeof(*mp))
432 (JNIEnv * env, jobject obj, jint context, jint release)
435 vl_api_generic_reply_t * mp;
441 return (VNET_API_ERROR_RESPONSE_NOT_READY);
453 mp = (vl_api_generic_reply_t *) (p[0]);
454 rv = clib_net_to_host_u32 (mp->retval);
457 u8 * free_me = (
u8 *) mp;
474 return strcmp ((
char *)n1->
name, (
char *)n2->
name);
478 (JNIEnv * env, jobject obj, jstring name_filter)
484 const char *this_name;
486 const char * nf = (*env)->GetStringUTFChars (env, name_filter,
NULL);
494 this_name = (const char *)(p->key);
495 if (strlen (nf) == 0 || strcasestr (this_name, nf)) {
496 vec_add2 (nses, ns, 1);
497 ns->name = (u8 *)(p->key);
498 ns->value = (u32) p->value[0];
505 s =
format (s, "%s: %d, ", ns->name, ns->value);
507 _vec_len (s) =
vec_len (s) - 2;
513 (*env)->ReleaseStringUTFChars (env, name_filter, nf);
515 rv = (*env)->NewStringUTF (env, (
char *) s);
522 (JNIEnv * env, jobject obj, jstring interfaceName)
526 const char * if_name = (*env)->GetStringUTFChars (env, interfaceName,
NULL);
539 (*env)->ReleaseStringUTFChars (env, interfaceName, if_name);
546 (JNIEnv * env, jobject obj, jint swIfIndex)
550 u32 sw_if_index = swIfIndex;
551 jobject result =
NULL;
563 result = vppInterfaceCountersObject(env,
579 (JNIEnv * env, jobject obj, jint swIfIndex)
584 jstring ifname =
NULL;
588 sw_if_index = swIfIndex;
594 if (!sw_if_details->
valid) {
599 ifname = (*env)->NewStringUTF(env, (
char *)s);
608 (JNIEnv * env, jobject obj)
622 (JNIEnv * env, jobject obj, jbyte name_filter_valid, jbyteArray name_filter)
631 clib_warning(
"swInterfaceDump sanity_check rv = %d", rv);
637 jsize cnt = (*env)->GetArrayLength (env, name_filter);
640 mp->
context = clib_host_to_net_u32 (my_context_id);
646 (*env)->GetByteArrayRegion(env, name_filter, 0, cnt, (jbyte *)mp->
name_filter);
656 M(CONTROL_PING, control_ping);
657 mp->
context = clib_host_to_net_u32 (my_context_id);
678 jobjectArray ifArray = vppInterfaceDetailsArray(env, len);
680 for (i = 0; i < len; i++) {
688 jstring ifname = (*env)->NewStringUTF(env, (
char *)s);
691 jbyteArray physAddr = (*env)->NewByteArray(env,
693 (*env)->SetByteArrayRegion(env, physAddr, 0,
696 jint subId = sw_if_details->
sub_id;
699 jint vtrOp = sw_if_details->
vtr_op;
701 jint vtrTag1 = sw_if_details->
vtr_tag1;
702 jint vtrTag2 = sw_if_details->
vtr_tag2;
703 jint linkMtu = sw_if_details->
link_mtu;
716 jobject ifObj = vppInterfaceDetailsObject(env,
718 supIfIndex, physAddr, adminUpDown, linkUpDown,
719 linkDuplex, linkSpeed, subId, subDot1ad,
720 subNumberOfTags, subOuterVlanId, subInnerVlanId,
721 subExactMatch, subDefault, subOuterVlanIdAny,
722 subInnerVlanIdAny, vtrOp, vtrPushDot1q, vtrTag1, vtrTag2, linkMtu);
723 (*env)->SetObjectArrayElement(env, ifArray, i, ifObj);
732 (JNIEnv * env, jobject obj, jstring bridgeDomain)
736 const char * bdName = (*env)->GetStringUTFChars (env, bridgeDomain,
NULL);
738 static u8 * bd_name = 0;
741 (*env)->ReleaseStringUTFChars (env, bridgeDomain, bdName);
747 _vec_len(bd_name) = 0;
753 (JNIEnv * env, jobject obj, jstring bridgeDomain)
757 const char * bdName = (*env)->GetStringUTFChars (env, bridgeDomain,
NULL);
759 static u8 * bd_name = 0;
762 (*env)->ReleaseStringUTFChars (env, bridgeDomain, bdName);
768 _vec_len(bd_name) = 0;
775 (JNIEnv * env, jobject obj, jstring interfaceName)
781 const char * if_name;
784 if_name = (*env)->GetStringUTFChars (env, interfaceName,
NULL);
791 sw_if_index = (jint) p[0];
800 (*env)->ReleaseStringUTFChars (env, interfaceName, if_name);
831 sw_if_details->
valid = 1;
861 DEBUG_LOG (
"Got interface %s", (
char *)s);
915 jintArray bdidArray = (*env)->NewIntArray(env,
vec_len(buf));
920 (*env)->SetIntArrayRegion(env, bdidArray, 0,
vec_len(buf), (
int*)buf);
942 (JNIEnv * env, jobject obj, jint bd_id)
959 M(BRIDGE_DOMAIN_DUMP, bridge_domain_dump);
960 mp->
context = clib_host_to_net_u32 (my_context_id);
961 mp->
bd_id = clib_host_to_net_u32(bd_id);
967 M(CONTROL_PING, control_ping);
991 bd_id = ntohl (mp->
bd_id);
999 bd_oper->
bd_id = bd_id;
1018 u32 bd_id, sw_if_index;
1020 bd_id = ntohl (mp->
bd_id);
1026 clib_warning(
"Invalid bd_id %d in bridge_domain_sw_if_details_t_handler", bd_id);
1029 u32 oper_bd_index = (jint) p[0];
1035 bd_sw_if_oper->
bd_id = bd_id;
1037 bd_sw_if_oper->
shg = mp->
shg;
1056 (JNIEnv * env, jobject obj, jint bdId)
1072 oper_bd_index = (jint) p[0];
1079 jobject bddObj = vppBridgeDomainDetailsObject(env);
1082 if (
NULL == vec_bd_name) {
1086 char *str_bd_name = (
char*)
format (0,
"%s%c", vec_bd_name, 0);
1088 jstring bdName = (*env)->NewStringUTF(env, str_bd_name);
1090 if (
NULL == bdName) {
1095 set_vppBridgeDomainDetails_name(env, bddObj, bdName);
1096 set_vppBridgeDomainDetails_bdId(env, bddObj, bdId);
1097 set_vppBridgeDomainDetails_flood(env, bddObj, (jboolean)bd_oper->
flood);
1098 set_vppBridgeDomainDetails_uuFlood(env, bddObj, (jboolean)bd_oper->
uu_flood);
1099 set_vppBridgeDomainDetails_forward(env, bddObj, (jboolean)bd_oper->
forward);
1100 set_vppBridgeDomainDetails_learn(env, bddObj, (jboolean)bd_oper->
learn);
1101 set_vppBridgeDomainDetails_arpTerm(env, bddObj, (jboolean)bd_oper->
arp_term);
1103 jstring bviInterfaceName =
NULL;
1106 if (
NULL == str_if_name) {
1111 bviInterfaceName = (*env)->NewStringUTF(env, str_if_name);
1112 if (
NULL == bviInterfaceName) {
1118 set_vppBridgeDomainDetails_bviInterfaceName(env, bddObj, bviInterfaceName);
1125 jobjectArray bdidArray = vppBridgeDomainInterfaceDetailsArray(env, len);
1128 for (i = 0; i < len; i++) {
1131 jobject bdidObj = vppBridgeDomainInterfaceDetailsObject(env);
1132 (*env)->SetObjectArrayElement(env, bdidArray, i, bdidObj);
1136 if (
NULL == str_if_name) {
1140 jstring interfaceName = (*env)->NewStringUTF(env, str_if_name);
1141 if (
NULL == interfaceName) {
1146 set_vppBridgeDomainInterfaceDetails_interfaceName(env, bdidObj, interfaceName);
1147 set_vppBridgeDomainInterfaceDetails_splitHorizonGroup(env, bdidObj, (jbyte)sw_if_oper->
shg);
1150 set_vppBridgeDomainDetails_interfaces(env, bddObj, bdidArray);
1165 if (
NULL == str_if_name) {
1168 jstring interfaceName = (*env)->NewStringUTF(env, str_if_name);
1169 if (
NULL == interfaceName) {
1173 jbyteArray physAddr = (*env)->NewByteArray(env, 6);
1174 (*env)->SetByteArrayRegion(env, physAddr, 0, 6,
1176 jboolean staticConfig = !l2_fib->
learned;
1177 jstring outgoingInterface = interfaceName;
1178 jboolean filter = l2_fib->
filter;
1179 jboolean bridgedVirtualInterface = l2_fib->
bvi;
1181 return vppL2FibObject(env, physAddr, staticConfig, outgoingInterface, filter, bridgedVirtualInterface);
1185 (JNIEnv * env, jobject obj, jint bd_id)
1190 jobjectArray l2FibArray =
NULL;
1206 oper_bd_index = p[0];
1211 M(L2_FIB_TABLE_DUMP, l2_fib_table_dump);
1212 mp->
bd_id = ntohl(bd_id);
1218 M(CONTROL_PING, control_ping);
1230 l2FibArray = vppL2FibArray(env, count);
1231 for (i = 0; i < count; i++) {
1234 (*env)->SetObjectArrayElement(env, l2FibArray, i, l2FibObj);
1250 u32 bd_id, oper_bd_index;
1255 bd_id = ntohl (mp->
bd_id);
1261 oper_bd_index = (jint) p[0];
1275 l2fib_oper->
bd_id = bd_id;
1284 (JNIEnv * env, jobject obj, jstring interfaceName, jboolean isIPv6)
1288 const char *if_name;
1295 if (
NULL == interfaceName) {
1299 if_name = (*env)->GetStringUTFChars (env, interfaceName,
NULL);
1305 (*env)->ReleaseStringUTFChars (env, interfaceName, if_name);
1309 sw_if_index = (
u32) p[0];
1317 M(IP_ADDRESS_DUMP, ip_address_dump);
1318 mp->
context = clib_host_to_net_u32 (my_context_id);
1319 mp->
sw_if_index = clib_host_to_net_u32(sw_if_index);
1327 M(CONTROL_PING, control_ping);
1337 (JNIEnv * env, jobject obj, jstring interfaceName)
1340 jobject returnArray =
NULL;
1354 jobjectArray ipv4AddressArray = vppIPv4AddressArray(env, count);
1356 for (i = 0; i < count; i++) {
1359 jint ip = address->
ip;
1362 jobject ipv4AddressObj = vppIPv4AddressObject(env, ip, prefixLength);
1364 (*env)->SetObjectArrayElement(env, ipv4AddressArray, i, ipv4AddressObj);
1367 returnArray = ipv4AddressArray;
1375 (JNIEnv * env, jobject obj, jstring interfaceName)
1378 jobject returnArray =
NULL;
1392 jobjectArray ipv6AddressArray = vppIPv6AddressArray(env, count);
1394 for (i = 0; i < count; i++) {
1397 jbyteArray ip = (*env)->NewByteArray(env, 16);
1398 (*env)->SetByteArrayRegion(env, ip, 0, 16,
1399 (
signed char*)address->
ip);
1403 jobject ipv6AddressObj = vppIPv6AddressObject(env, ip, prefixLength);
1405 (*env)->SetObjectArrayElement(env, ipv6AddressArray, i, ipv6AddressObj);
1408 returnArray = ipv6AddressArray;
1432 #define VXLAN_TUNNEL_INTERFACE_NAME_PREFIX "vxlan_tunnel" 1435 (JNIEnv * env, jobject obj, jint swIfIndex)
1439 jobjectArray returnArray =
NULL;
1450 M(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump);
1451 mp->
context = clib_host_to_net_u32 (my_context_id);
1452 mp->
sw_if_index = clib_host_to_net_u32 (swIfIndex);
1458 M(CONTROL_PING, control_ping);
1469 jobjectArray vxlanTunnelDetailsArray = vppVxlanTunnelDetailsArray(env, count);
1471 for (i = 0; i < count; i++) {
1476 jbyteArray src_address = (*env)->NewByteArray(env, 16);
1477 (*env)->SetByteArrayRegion(env, src_address, 0, 16,
1480 jbyteArray dst_address = (*env)->NewByteArray(env, 16);
1481 (*env)->SetByteArrayRegion(env, dst_address, 0, 16,
1485 jint vni = details->
vni;
1487 jboolean is_ipv6 = details->
is_ipv6 ? 1 : 0;
1489 jobject vxlanTunnelDetailsObj = vppVxlanTunnelDetailsObject(env,
1490 src_address, dst_address, encap_vrf_id, vni,
1491 decap_next_index, is_ipv6);
1493 (*env)->SetObjectArrayElement(env, vxlanTunnelDetailsArray, i,
1494 vxlanTunnelDetailsObj);
1497 returnArray = vxlanTunnelDetailsArray;
1520 #if CLIB_ARCH_IS_LITTLE_ENDIAN 1521 d[0] = clib_net_to_host_u64(s[1]);
1522 d[1] = clib_net_to_host_u64(s[0]);
1530 #if CLIB_ARCH_IS_LITTLE_ENDIAN 1531 d[0] = clib_net_to_host_u64(s[1]);
1532 d[1] = clib_net_to_host_u64(s[0]);
1553 tunnel_details->
vni = ntohl(mp->
vni);
1565 int getEnvStat = (*jm->
jvm)->GetEnv(jm->
jvm, (
void **)&(jm->
jenv), JNI_VERSION_1_6);
1566 if (getEnvStat == JNI_EVERSION) {
1570 }
else if (getEnvStat != JNI_EDETACHED) {
1571 (*jm->
jvm)->DetachCurrentThread(jm->
jvm);
1584 DEBUG_LOG (
"show version request succeeded(%d)");
1601 clib_error (
"show version request failed(%d)", retval);
1624 int getEnvStat = (*jm->
jvm)->GetEnv(jm->
jvm, (
void **)&(jm->
jenv), JNI_VERSION_1_6);
1625 if (getEnvStat == JNI_EDETACHED) {
1626 if ((*jm->
jvm)->AttachCurrentThread(jm->
jvm, (
void **)&(jm->
jenv),
NULL) != 0) {
1636 }
else if (getEnvStat == JNI_EVERSION) {
1649 JNIEnv *env = jm->
jenv;
1661 jobject obj = (jobject)p[0];
1664 case VL_API_SW_INTERFACE_DUMP:
1665 if (0 != sw_if_dump_call_all_callbacks(obj)) {
1670 clib_warning(
"Unhandled control ping issuer msg-id: %d", msg_id);
1678 (*env)->DeleteGlobalRef(env, obj);
1686 #define VPPJNI_DEBUG_COUNTERS 0 1693 u32 count, sw_if_index;
1698 count = ntohl (mp->
count);
1704 for (i = 0; i < count; i++) {
1708 v = clib_net_to_host_u64 (v);
1723 counter_name =
"drop";
1727 counter_name =
"punt";
1731 counter_name =
"ip4";
1735 counter_name =
"ip6";
1739 counter_name =
"rx-no-buf";
1743 counter_name =
"rx-miss";
1747 counter_name =
"rx-error";
1751 counter_name =
"tx-error (fifo-full)";
1755 counter_name =
"bogus";
1759 #if VPPJNI_DEBUG_COUNTERS == 1 1771 for (i = 0; i < count; i++) {
1775 packets = clib_net_to_host_u64 (packets);
1777 bytes = clib_net_to_host_u64 (bytes);
1794 counter_name =
"rx";
1800 counter_name =
"tx";
1804 counter_name =
"bogus";
1808 #if VPPJNI_DEBUG_COUNTERS == 1 1811 sw_if_index, counter_name, packets);
1814 sw_if_index, counter_name, bytes);
1826 if ((*vm)->GetEnv(vm, (
void**) &env, JNI_VERSION_1_6) != JNI_OK) {
1835 return JNI_VERSION_1_6;
1841 if ((*vm)->GetEnv(vm, (
void**) &env, JNI_VERSION_1_6) != JNI_OK) {
1851 #define foreach_vpe_api_msg \ 1852 _(CONTROL_PING_REPLY, control_ping_reply) \ 1853 _(SW_INTERFACE_DETAILS, sw_interface_details) \ 1854 _(SHOW_VERSION_REPLY, show_version_reply) \ 1855 _(WANT_STATS_REPLY, want_stats_reply) \ 1856 _(VNET_INTERFACE_COUNTERS, vnet_interface_counters) \ 1857 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \ 1858 _(BRIDGE_DOMAIN_DETAILS, bridge_domain_details) \ 1859 _(BRIDGE_DOMAIN_SW_IF_DETAILS, bridge_domain_sw_if_details) \ 1860 _(L2_FIB_TABLE_ENTRY, l2_fib_table_entry) \ 1861 _(IP_ADDRESS_DETAILS, ip_address_details) \ 1862 _(VXLAN_TUNNEL_DETAILS, vxlan_tunnel_details) 1876 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1877 vl_api_##n##_t_handler, \ 1879 vl_api_##n##_t_endian, \ 1880 vl_api_##n##_t_print, \ 1881 sizeof(vl_api_##n##_t), 1); 1892 u32 max_zero_run = 0, this_zero_run = 0;
1893 int max_zero_run_index = -1, this_zero_run_index=0;
1894 int in_zero_run = 0,
i;
1895 int last_double_colon = 0;
1905 this_zero_run_index =
i;
1910 if (this_zero_run > max_zero_run && this_zero_run > 1) {
1911 max_zero_run_index = this_zero_run_index;
1912 max_zero_run = this_zero_run;
1921 if (this_zero_run > max_zero_run && this_zero_run > 1) {
1922 max_zero_run_index = this_zero_run_index;
1923 max_zero_run = this_zero_run;
1928 if (
i == max_zero_run_index) {
1930 i += max_zero_run - 1;
1931 last_double_colon = 1;
1934 (last_double_colon ||
i == 0) ?
"" :
":",
1935 clib_net_to_host_u16 (a->
as_u16[
i]));
1936 last_double_colon = 0;
1946 u8 *
a = va_arg (*args,
u8 *);
1947 return format (s,
"%d.%d.%d.%d", a[0], a[1], a[2], a[3]);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
jint JNI_OnLoad(JavaVM *vm, void *reserved)
int vl_client_connect_to_vlib(char *svm_name, char *client_name, int rx_queue_size)
struct l2fib_u64_mac_t::@183::@185 fields
static void vl_api_bridge_domain_details_t_handler(vl_api_bridge_domain_details_t *mp)
BIND_JAPI_STRING_FIELD(vppBridgeDomainDetails, name)
Want Stats, register for stats updates.
sw_interface_details_t * sw_if_table
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
ipv4_address_t * ipv4_addresses
vxlan_tunnel_details_t * vxlan_tunnel_details
pthread_key_t cleanup_rx_thread_key
#define hash_unset(h, key)
Set flags on the interface.
Control ping from client to api server request.
static jobject l2_fib_create_object(JNIEnv *env, bd_l2fib_oper_t *l2_fib)
Reply for Want Stats request.
void vl_client_disconnect_from_vlib(void)
vppjni_main_t vppjni_main
unix_shared_memory_queue_t * vl_input_queue
static int jm_show_version(vppjni_main_t *jm)
uword * bd_id_by_sw_if_index
L2 bridge domain sw interface operational state response.
static void vl_api_ip_address_details_t_handler(vl_api_ip_address_details_t *mp)
#define clib_error(format, args...)
static void vl_api_sw_interface_details_t_handler(vl_api_sw_interface_details_t *mp)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_set_mem(h, key, value)
static const char * interface_name_from_sw_if_index(u32 sw_if_index)
static jintArray create_array_of_bd_ids(JNIEnv *env, jint bd_id)
JNIEXPORT void JNICALL Java_org_openvpp_vppjapi_vppConn_clearInterfaceTable0(JNIEnv *env, jobject obj)
L2 bridge domain request operational state details.
static void vppjni_unlock(vppjni_main_t *jm)
JNIEXPORT jintArray JNICALL Java_org_openvpp_vppjapi_vppConn_bridgeDomainDump0(JNIEnv *env, jobject obj, jint bd_id)
#define MHEAP_FLAG_THREAD_SAFE
int vppjni_init(JNIEnv *env)
trace_cfg_t * api_trace_cfg
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static int vppjni_sanity_check(vppjni_main_t *jm)
#define foreach_vpe_api_msg
u8 * format_ip4_address(u8 *s, va_list *args)
BIND_JAPI_BOOL_FIELD(vppBridgeDomainDetails, arpTerm)
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_getRetval0(JNIEnv *env, jobject obj, jint context, jint release)
L2 bridge domain operational state response.
void vppjni_uninit(JNIEnv *env)
always_inline void * clib_mem_get_per_cpu_heap(void)
static void vl_api_l2_fib_table_entry_t_handler(vl_api_l2_fib_table_entry_t *mp)
sw_interface_stats_t * sw_if_stats_by_sw_if_index
BIND_JAPI_OBJ_FIELD(vppBridgeDomainDetails, interfaces,"[Lorg/openvpp/vppjapi/vppBridgeDomainInterfaceDetails;")
JNIEXPORT jobject JNICALL Java_org_openvpp_vppjapi_vppConn_getInterfaceCounters0(JNIEnv *env, jobject obj, jint swIfIndex)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
always_inline uword mhash_elts(mhash_t *m)
#define clib_warning(format, args...)
static int sw_interface_dump(vppjni_main_t *jm)
struct vl_shmem_hdr_ * shmem_hdr
static void vl_api_vxlan_tunnel_details_t_handler(vl_api_vxlan_tunnel_details_t *mp)
BIND_JAPI_BYTE_FIELD(vppBridgeDomainInterfaceDetails, splitHorizonGroup)
always_inline mheap_t * mheap_header(u8 *v)
static void vl_api_control_ping_reply_t_handler(vl_api_control_ping_reply_t *mp)
#define hash_create_string(elts, value_bytes)
static void vl_api_vnet_interface_counters_t_handler(vl_api_vnet_interface_counters_t *mp)
static void vl_api_show_version_reply_t_handler(vl_api_show_version_reply_t *mp)
Dump l2 fib (aka bridge domain) table.
static_always_inline void vjbd_main_init(vjbd_main_t *bdm)
JNIEXPORT jstring JNICALL Java_org_openvpp_vppjapi_vppConn_interfaceNameFromSwIfIndex0(JNIEnv *env, jobject obj, jint swIfIndex)
static void cleanup_rx_thread(void *arg)
JNIEXPORT jobject JNICALL Java_org_openvpp_vppjapi_vppConn_getVppVersion0(JNIEnv *env, jobject obj)
static void vppjni_lock(vppjni_main_t *jm, u32 tag)
uword mhash_set_mem(mhash_t *h, void *key, uword *new_value, uword *old_value)
BIND_JAPI_INT_FIELD(vppBridgeDomainDetails, bdId)
JNIEXPORT jobjectArray JNICALL Java_org_openvpp_vppjapi_vppConn_swInterfaceDump0(JNIEnv *env, jobject obj, jbyte name_filter_valid, jbyteArray name_filter)
JNIEXPORT void JNICALL Java_org_openvpp_vppjapi_vppConn_clientDisconnect(JNIEnv *env, jobject obj)
volatile u32 result_ready
static int ipAddressDump(JNIEnv *env, jobject obj, jstring interfaceName, jboolean isIPv6)
static_always_inline u32 vjbd_id_from_name(vjbd_main_t *bdm, const u8 *bd_name)
void clib_time_init(clib_time_t *c)
u8 * format_ip6_address(u8 *s, va_list *args)
volatile u32 context_id_received
static int connect_to_vpe(char *name)
static int name_sort_cmp(void *a1, void *a2)
uword * sw_if_config_by_sw_if_index
void * clib_mem_init(void *heap, uword size)
static void vl_api_want_stats_reply_t_handler(vl_api_want_stats_reply_t *mp)
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_clientConnect(JNIEnv *env, jobject obj, jstring clientName)
void vl_api_generic_reply_handler(vl_api_generic_reply_t *mp)
bd_sw_if_oper_t * bd_sw_if_oper
u32 * sw_if_dump_if_indices
void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
always_inline void * clib_mem_alloc(uword size)
static void bridge_domain_oper_free(void)
#define vec_free(V)
Free vector's memory (no header).
static_always_inline u32 vjbd_find_or_add_bd(vjbd_main_t *bdm, u8 *bd_name)
#define clib_memcpy(a, b, c)
static_always_inline u8 * vjbd_oper_name_from_id(vjbd_main_t *bdm, u32 bd_id)
#define vec_validate_init_c_string(V, S, L)
Make a vector containing a NULL terminated c-string.
#define hash_create(elts, value_bytes)
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_bridgeDomainIdFromInterfaceName0(JNIEnv *env, jobject obj, jstring interfaceName)
l2 fib table entry structure
JNIEXPORT jobject JNICALL Java_org_openvpp_vppjapi_vppConn_getBridgeDomainDetails0(JNIEnv *env, jobject obj, jint bdId)
static u32 vppjni_get_context_id(vppjni_main_t *jm)
JNIEXPORT jstring JNICALL Java_org_openvpp_vppjapi_vppConn_getInterfaceList0(JNIEnv *env, jobject obj, jstring name_filter)
void JNI_OnUnload(JavaVM *vm, void *reserved)
static int jm_stats_enable_disable(vppjni_main_t *jm, u8 enable)
JNIEXPORT jobjectArray JNICALL Java_org_openvpp_vppjapi_vppConn_l2FibTableDump0(JNIEnv *env, jobject obj, jint bd_id)
JNIEXPORT jobjectArray JNICALL Java_org_openvpp_vppjapi_vppConn_ipv6AddressDump0(JNIEnv *env, jobject obj, jstring interfaceName)
Control ping from the client to the server response.
uword * oper_bd_index_by_bd_id
BIND_JAPI_CLASS(vppBridgeDomainDetails,"()V")
static void vl_api_sw_interface_set_flags_t_handler(vl_api_sw_interface_set_flags_t *mp)
void vl_client_add_api_signatures(vl_api_memclnt_create_t *mp)
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_findOrAddBridgeDomainId0(JNIEnv *env, jobject obj, jstring bridgeDomain)
mhash_t l2fib_index_by_mac
uword * sw_if_index_by_interface_name
sw_interface_subif_t * sw_if_subif_table
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_bridgeDomainIdFromName0(JNIEnv *env, jobject obj, jstring bridgeDomain)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define hash_foreach_pair(p, v, body)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
always_inline u64 l2fib_mac_to_u64(u8 *mac_address)
unix_shared_memory_queue_t * vl_input_queue
Want stats counters structure.
#define clib_mem_unaligned(pointer, type)
#define hash_get_mem(h, key)
JNIEXPORT jstring JNICALL Java_org_openvpp_vppjapi_vppConn_getInterfaceDescription0(JNIEnv *env, jobject obj, jstring ifName)
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_swIfIndexFromName0(JNIEnv *env, jobject obj, jstring interfaceName)
static jobjectArray sw_if_dump_get_interfaces()
#define vec_foreach(var, vec)
Vector iterator.
bd_l2fib_oper_t * l2fib_oper
Interface details structure (fix this)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
ipv6_address_t * ipv6_addresses
static void vl_api_bridge_domain_sw_if_details_t_handler(vl_api_bridge_domain_sw_if_details_t *mp)
JNIEXPORT jobjectArray JNICALL Java_org_openvpp_vppjapi_vppConn_ipv4AddressDump0(JNIEnv *env, jobject obj, jstring interfaceName)
JNIEXPORT jobjectArray JNICALL Java_org_openvpp_vppjapi_vppConn_vxlanTunnelDump0(JNIEnv *env, jobject obj, jint swIfIndex)
JNIEXPORT jint JNICALL Java_org_openvpp_vppjapi_vppConn_setInterfaceDescription0(JNIEnv *env, jobject obj, jstring ifName, jstring ifDesc)