X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=d4fde0a6c8eeca5f1b54a19b229c9590958265c8;hp=c1bde497420b329998f15a17087a7f89d674401e;hb=a95c54b7821596402e0aa7136cd7d1de71a5b187;hpb=ec120d957cfec192d30e84a0d337198153214a70 diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index c1bde49742..d4fde0a6c8 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -382,6 +382,96 @@ class VppConfigGenerator(object): path = ['nat'] self.add_config_item(self._nodeconfig, value, path) + def add_tcp_preallocated_connections(self, value): + """Add TCP pre-allocated connections. + + :param value: The number of pre-allocated connections. + :type value: int + """ + path = ['tcp', 'preallocated-connections'] + self.add_config_item(self._nodeconfig, value, path) + + def add_tcp_preallocated_half_open_connections(self, value): + """Add TCP pre-allocated half open connections. + + :param value: The number of pre-allocated half open connections. + :type value: int + """ + path = ['tcp', 'preallocated-half-open-connections'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_event_queue_length(self, value): + """Add session event queue length. + + :param value: Session event queue length. + :type value: int + """ + path = ['session', 'event-queue-length'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_preallocated_sessions(self, value): + """Add the number of pre-allocated sessions. + + :param value: Number of pre-allocated sessions. + :type value: int + """ + path = ['session', 'preallocated-sessions'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_v4_session_table_buckets(self, value): + """Add number of v4 session table buckets to the config. + + :param value: Number of v4 session table buckets. + :type value: int + """ + path = ['session', 'v4-session-table-buckets'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_v4_session_table_memory(self, value): + """Add the size of v4 session table memory. + + :param value: Size of v4 session table memory. + :type value: str + """ + path = ['session', 'v4-session-table-memory'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_v4_halfopen_table_buckets(self, value): + """Add the number of v4 halfopen table buckets. + + :param value: Number of v4 halfopen table buckets. + :type value: int + """ + path = ['session', 'v4-halfopen-table-buckets'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_v4_halfopen_table_memory(self, value): + """Add the size of v4 halfopen table memory. + + :param value: Size of v4 halfopen table memory. + :type value: str + """ + path = ['session', 'v4-halfopen-table-memory'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_local_endpoints_table_buckets(self, value): + """Add the number of local endpoints table buckets. + + :param value: Number of local endpoints table buckets. + :type value: int + """ + path = ['session', 'local-endpoints-table-buckets'] + self.add_config_item(self._nodeconfig, value, path) + + def add_session_local_endpoints_table_memory(self, value): + """Add the size of local endpoints table memory. + + :param value: Size of local endpoints table memory. + :type value: str + """ + path = ['session', 'local-endpoints-table-memory'] + self.add_config_item(self._nodeconfig, value, path) + def apply_config(self, filename=None, waittime=5, retries=12, restart_vpp=True): """Generate and apply VPP configuration for node.