Hi Hal This patch is a QoS parser header file that defines parse tree data structures.
Signed-off-by: Yevgeny Kliteynik <[EMAIL PROTECTED]> --- osm/include/opensm/osm_qos_parser.h | 172 +++++++++++++++++++++++++++++++++++ 1 files changed, 172 insertions(+), 0 deletions(-) diff --git a/osm/include/opensm/osm_qos_parser.h b/osm/include/opensm/osm_qos_parser.h new file mode 100644 index 0000000..4e27c8c --- /dev/null +++ b/osm/include/opensm/osm_qos_parser.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +/* + * Abstract: + * Declaration of OSM QoS parser. + * + * Environment: + * Linux User Mode + * + * Author: + * Yevgeny Kliteynik, Mellanox + */ + +#ifndef OSM_QOS_PARSER_H +#define OSM_QOS_PARSER_H + +#include <stdio.h> +#include <assert.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <iba/ib_types.h> +#include <opensm/osm_log.h> +#include <opensm/osm_opensm.h> + +#define YYSTYPE char * + +#define OSM_QOS_NODE_TYPE_CA "CA" +#define OSM_QOS_NODE_TYPE_SWITCH "SWITCH" +#define OSM_QOS_NODE_TYPE_ROUTER "ROUTER" + +typedef enum {UNDEF, ROUTER, CA, SWITCH} node_type_t; + +/***************************************************/ + +typedef struct osm_qos_string_vector_item_t_ { + cl_map_item_t map_item; + char * str; +} osm_qos_string_vector_item_t; + +typedef struct osm_qos_uint64_vector_item_t_ { + cl_map_item_t map_item; + uint64_t value; +} osm_qos_uint64_vector_item_t; + +typedef struct osm_qos_uint32_vector_item_t_ { + cl_map_item_t map_item; + uint32_t value; +} osm_qos_uint32_vector_item_t; + +typedef struct osm_qos_vlarb_hl_vector_item_t_ { + cl_map_item_t map_item; + uint32_t sl; + uint32_t credits; +} osm_qos_vlarb_hl_vector_item_t; + +/***************************************************/ + +typedef struct osm_qos_port_group_t_ { + cl_map_item_t map_item; + char * name; + char * use; + cl_ptr_vector_t port_guids; /* vector of uint64_t */ + cl_ptr_vector_t port_names; /* vector of string */ + cl_ptr_vector_t partitions; /* vector of string */ + cl_ptr_vector_t node_types; /* vector of uint8_t */ +} osm_qos_port_group_t; + +/***************************************************/ + +typedef struct osm_qos_sl2vl_scope_t_ { + cl_map_item_t map_item; + cl_ptr_vector_t groups; /* vector of string */ + cl_ptr_vector_t from; /* vector of string */ + cl_ptr_vector_t to; /* vector of string */ + cl_ptr_vector_t across_from; /* vector of string */ + cl_ptr_vector_t across_to; /* vector of string */ + uint8_t sl2vl_table[16]; +} osm_qos_sl2vl_scope_t; + +/***************************************************/ + +typedef struct osm_qos_vlarb_scope_t_ { + cl_map_item_t map_item; + cl_ptr_vector_t groups; /* vector of string */ + cl_ptr_vector_t across; /* vector of string */ + cl_ptr_vector_t vlarb_highs; /* vector of string */ + cl_ptr_vector_t vlarb_lows; /* vector of string */ + uint32_t vl_high_limit; +} osm_qos_vlarb_scope_t; + +/***************************************************/ + +typedef struct osm_qos_level_t_ { + cl_map_item_t map_item; + char * use; + uint32_t sn; + uint32_t sl; + uint32_t mtu_limit; + uint32_t rate_limit; + uint32_t class; +} osm_qos_level_t; + +/***************************************************/ + +typedef struct osm_qos_match_rule_t_ { + cl_map_item_t map_item; + char * use; + char * source; + char * destination; + cl_ptr_vector_t services; /* vector of uint32 */ + cl_ptr_vector_t qos_level_sns; /* vector of uint32 */ + cl_ptr_vector_t classes; /* vector of uint32 */ +} osm_qos_match_rule_t; + +/***************************************************/ + +typedef struct osm_qos_parse_tree_t_ { + cl_map_item_t map_item; + cl_ptr_vector_t port_groups; /* vector of osm_qos_port_group_t */ + cl_ptr_vector_t sl2vl_tables; /* vector of osm_qos_sl2vl_scope_t */ + cl_ptr_vector_t vlarb_tables; /* vector of osm_qos_vlarb_scope_t */ + cl_ptr_vector_t qos_levels; /* vector of osm_qos_level_t */ + cl_ptr_vector_t qos_match_rules; /* vector of osm_qos_match_rule_t */ +} osm_qos_parse_tree_t; + +/***************************************************/ + +int osm_qos_parse_policy_file( + IN osm_log_t * p_log, + IN const char * policy_file, + OUT osm_qos_parse_tree_t ** pp_qos_parse_tree); + +void osm_qos_parser_destroy_parse_tree( + IN osm_qos_parse_tree_t * p_qos_parse_tree); + +/***************************************************/ + +#endif /* ifndef OSM_QOS_PARSER_H */ -- 1.4.4.1.GIT _______________________________________________ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general