bfd.c (3571B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 7 * 8 * This program is the proprietary software of Broadcom Corporation 9 * and/or its licensors, and may only be used, duplicated, modified 10 * or distributed pursuant to the terms and conditions of a separate, 11 * written license agreement executed between you and Broadcom 12 * (an "Authorized License"). Except as set forth in an Authorized 13 * License, Broadcom grants no license (express or implied), right 14 * to use, or waiver of any kind with respect to the Software, and 15 * Broadcom expressly reserves all rights in and to the Software and 16 * all intellectual property rights therein. IF YOU HAVE NO AUTHORIZED 17 * LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, 18 * AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE 19 * OF THE SOFTWARE. 20 * 21 * Except as expressly set forth in the Authorized License, 22 * 23 * 1. This program, including its structure, sequence and organization, 24 * constitutes the valuable trade secrets of Broadcom, and you shall use 25 * all reasonable efforts to protect the confidentiality thereof, and 26 * to use this information only in connection with your use of Broadcom 27 * integrated circuit products. 28 * 29 * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED 30 * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, 31 * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, 32 * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY 33 * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, 34 * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, 35 * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR 36 * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING 37 * OUT OF USE OR PERFORMANCE OF THE SOFTWARE. 38 * 39 * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM 40 * OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, 41 * INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY 42 * RELATING TO YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF 43 * BROADCOM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) 44 * ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE 45 * ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE LIMITATIONS SHALL 46 * APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED 47 * REMEDY. 48 */ 49 50 #if defined (INCLUDE_BFD) 51 52 #include <sal/core/libc.h> 53 #include <bcm/bfd.h> 54 #include <bcm_int/esw/bfd_feature.h> 55 56 /*Global to hold the bfd firmware version for feature compatibility check */ 57 uint32 bfd_firmware_version = BFD_UC_MIN_VERSION; 58 59 /* 60 * Function: 61 * bcm_bfd_endpoint_info_t_init 62 * Purpose: 63 * Initialize an BFD endpoint info structure 64 * Parameters: 65 * endpoint_info - (OUT) Pointer to BFD endpoint info structure to be initialized 66 * Returns: 67 * BCM_E_XXX 68 * Notes: 69 */ 70 void 71 bcm_bfd_endpoint_info_t_init( 72 bcm_bfd_endpoint_info_t *endpoint_info) 73 { 74 sal_memset(endpoint_info, 0, sizeof(bcm_bfd_endpoint_info_t)); 75 endpoint_info->gport = BCM_GPORT_INVALID; 76 endpoint_info->tx_gport = BCM_GPORT_INVALID; 77 endpoint_info->remote_gport = BCM_GPORT_INVALID; 78 #ifdef INCLUDE_L3 79 bcm_mpls_egress_label_t_init(&endpoint_info->egress_label); 80 #endif 81 endpoint_info->egress_label.exp = 0xFF; 82 } 83 84 #else /* INCLUDE_BFD */ 85 int _bcm_common_bfd_not_empty; 86 #endif /* INCLUDE_BFD */