bfd_pack.h (2647B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: bfd_pack.h 8 * Purpose: Interface to pack and unpack routines common to 9 * SDK and uKernel for: 10 * - BFD Control messages 11 * - Network Packet headers 12 * 13 * This is to be shared between SDK host and uKernel. 14 */ 15 16 #ifndef _SOC_SHARED_BFD_PACK_H_ 17 #define _SOC_SHARED_BFD_PACK_H_ 18 19 #ifdef BCM_UKERNEL 20 /* Build for uKernel not SDK */ 21 #include "sdk_typedefs.h" 22 #else 23 #include <sal/types.h> 24 #endif 25 26 #include <soc/shared/bfd_msg.h> 27 #include <soc/shared/bfd_pkt.h> 28 29 /* BFD Control Messages pack/unpack */ 30 31 extern uint8 * 32 shr_bfd_msg_ctrl_sess_set_pack(uint8 *buf, 33 shr_bfd_msg_ctrl_sess_set_t *msg); 34 extern uint8 * 35 shr_bfd_msg_ctrl_sess_set_unpack(uint8 *buf, 36 shr_bfd_msg_ctrl_sess_set_t *msg); 37 38 extern uint8 * 39 shr_bfd_msg_ctrl_sess_get_pack(uint8 *buf, 40 shr_bfd_msg_ctrl_sess_get_t *msg); 41 extern uint8 * 42 shr_bfd_msg_ctrl_sess_get_unpack(uint8 *buf, 43 shr_bfd_msg_ctrl_sess_get_t *msg); 44 45 extern uint8 * 46 shr_bfd_msg_ctrl_auth_sha1_pack(uint8 *buf, 47 shr_bfd_msg_ctrl_auth_sha1_t *msg); 48 extern uint8 * 49 shr_bfd_msg_ctrl_auth_sha1_unpack(uint8 *buf, 50 shr_bfd_msg_ctrl_auth_sha1_t *msg); 51 52 extern uint8 * 53 shr_bfd_msg_ctrl_auth_sp_pack(uint8 *buf, shr_bfd_msg_ctrl_auth_sp_t *msg); 54 extern uint8 * 55 shr_bfd_msg_ctrl_auth_sp_unpack(uint8 *buf, shr_bfd_msg_ctrl_auth_sp_t *msg); 56 57 extern uint8 * 58 shr_bfd_msg_ctrl_stat_req_pack(uint8 *buf, 59 shr_bfd_msg_ctrl_stat_req_t *msg); 60 extern uint8 * 61 shr_bfd_msg_ctrl_stat_req_unpack(uint8 *buf, 62 shr_bfd_msg_ctrl_stat_req_t *msg); 63 64 extern uint8 * 65 shr_bfd_msg_ctrl_stat_reply_pack(uint8 *buf, 66 shr_bfd_msg_ctrl_stat_reply_t *msg); 67 extern uint8 * 68 shr_bfd_msg_ctrl_stat_reply_unpack(uint8 *buf, 69 shr_bfd_msg_ctrl_stat_reply_t *msg); 70 71 /* BFD Network Packet headers pack/unpack */ 72 extern uint8 * 73 shr_bfd_header_pack(uint8 *buf, shr_bfd_header_t *bfd); 74 extern uint8 * 75 shr_bfd_header_unpack(uint8 *buf, shr_bfd_header_t *bfd); 76 77 extern uint8 * 78 shr_bfd_auth_header_pack(uint8 *buf, shr_bfd_auth_header_t *auth); 79 extern uint8 * 80 shr_bfd_auth_header_unpack(uint8 *buf, shr_bfd_auth_header_t *auth); 81 82 #endif /* _SOC_SHARED_BFD_PACK_H_ */