# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
-# l
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
return my_context_id;
}""")
+
def generate_jni_impl(func_list, plugin_name, inputfile):
jni_impl = []
for f in func_list:
f_name = f['name']
camel_case_function_name = util.underscore_to_camelcase(f_name)
- if is_manually_generated(f_name) or util.is_reply(camel_case_function_name) \
- or util.is_notification(f_name):
+ if is_manually_generated(f_name):
+ # Skip control ping managed by jvpp registry.
+ continue
+ if not (util.is_dump(f_name) or util.is_request(f_name, func_list)):
continue
+ # Generate jni bindings for sending dump and request messages.
arguments = ''
request_class = ''
jni_identifiers = ''
ref_name = util.underscore_to_camelcase(handler_name)
if is_manually_generated(handler_name):
+ # Skip control ping managed by jvpp registry.
continue
-
- if not util.is_reply(dto_name) and not util.is_notification(handler_name):
+ if util.is_dump(handler_name) or util.is_request(handler_name, func_list):
continue
+ # Generate msg handlers for all messages except for dumps and requests (handled by vpp, not client).
dto_setters = ''
err_handler = ''
# dto setters
handler_registration = ["#define foreach_api_reply_handler \\\n"]
for f in func_list:
name = f['name']
- camelcase_name = util.underscore_to_camelcase(f['name'])
+ camelcase_name = util.underscore_to_camelcase(name)
- if (not util.is_reply(camelcase_name) and not util.is_notification(name)) \
- or util.is_control_ping(camelcase_name):
+ if util.is_control_ping(camelcase_name):
+ # Skip control ping managed by registry.
+ continue
+ if util.is_dump(name) or util.is_request(name, func_list):
continue
+ # Generate msg handler registration for all messages except for dumps and requests.
handler_registration.append(handler_registration_template.substitute(
name=name,
crc=f['crc']))
$handler_registration
""")
+
def generate_jvpp(func_list, plugin_name, inputfile, path):
""" Generates jvpp C file """
print "Generating jvpp C"