/* ****************************************************************************** * INTERPEAK SOURCE FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmipfa_pktbuf.c,v $ $Revision: 1.9 $ * $Source: /home/interpeak/CVSRoot/ipmipfa/config/ipmipfa_pktbuf.c,v $ * $Author: jhorteli $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Joel Hortelius ****************************************************************************** */ /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ #include "ipmipfa_config.h" /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #define IPCOM_USE_CLIB_PROTO #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ipmipfa.h" #include "ipmipfa_h.h" #include "ipmipfa_pktbuf.h" /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ /* **************************************************************************** * 6 EXTERN PROTOTYPES **************************************************************************** */ /* **************************************************************************** * 7 LOCAL PROTOTYPES **************************************************************************** */ /* **************************************************************************** * 8 DATA **************************************************************************** */ /* **************************************************************************** * 9 STATIC FUNCTIONS **************************************************************************** */ /* **************************************************************************** * 10 GLOBAL FUNCTIONS **************************************************************************** */ /* *=========================================================================== * ipmipfa_pktbuf_alloc *=========================================================================== * Description: Allocate a packet buffer * Parameters: * Returns: A newly allocated packet buffer * */ IP_GLOBAL Ipmip_pktbuf_t * ipmipfa_pktbuf_alloc(Ipmip4_context_t *ctx, Ipmip_proc_t *proc, Ip_size_t extra) { Ipmipfa_pktbuf_t *pbuf; IPMIP_UNUSED_PARAMETER(ctx); IPMIP_UNUSED_PARAMETER(proc); /* Return a Ipmipfa_pktbuf_t */ pbuf = ipcom_calloc(1, sizeof(Ipmipfa_pktbuf_t) + extra); if (pbuf) { pbuf->ipmip4.ipmip.pktend = (void *) (pbuf + 1); return &pbuf->ipmip4.ipmip; } return IP_NULL; } /* *=========================================================================== * ipmipfa_pktbuf_free *=========================================================================== * Description: Free a packet buffer * Parameters: pbuf - The packet buffer * Returns: * */ IP_GLOBAL void ipmipfa_pktbuf_free(Ipmip4_context_t *ctx, Ipmip_proc_t *proc, Ipmipfa_pktbuf_t *pbuf) { IPMIP_UNUSED_PARAMETER(ctx); IPMIP_UNUSED_PARAMETER(proc); /** FREE ANY IPMIPFA SPECIFIC INFO THAT HAS BEEN STORED */ if (pbuf->faVisitorChallenge != IP_NULL) ipcom_free(pbuf->faVisitorChallenge); if (pbuf->llhinfo.faVisitorLLA != IP_NULL) ipcom_free(pbuf->llhinfo.faVisitorLLA); if (pbuf->llhinfo.faVisitorAFA != IP_NULL) ipcom_free(pbuf->llhinfo.faVisitorAFA); /* Free the data */ ipcom_free(pbuf); } /* **************************************************************************** * 11 PUBLIC FUNCTIONS **************************************************************************** */ /* **************************************************************************** * END OF FILE **************************************************************************** */