VOS_VOID CDS_SaveIpv6FragmentInfo(const CDS_IPV6_FRAGMENT_INFO_STRU *pstSrcInfo)
{
    CDS_IPV6_FRAGMENT_BUFF_STRU     *pstIpv6FragBuff;
    CDS_IPV6_FRAGMENT_INFO_STRU     *pstDstInfo;

    CDS_ASSERT(VOS_NULL_PTR != pstSrcInfo);
    pstIpv6FragBuff = CDS_GET_IPV6_FRAGMENT_BUFF();
    pstDstInfo = &(pstIpv6FragBuff->astSegBuff[pstIpv6FragBuff->ulIndex]);
    pstIpv6FragBuff->ulIndex = TTF_MOD_ADD(pstIpv6FragBuff->ulIndex,1,CDS_IPV6_FRAGMENT_BUFF_SIZE);
    PS_MEM_CPY(pstDstInfo,pstSrcInfo,sizeof(CDS_IPV6_FRAGMENT_INFO_STRU));

    return;
}
Exemple #2
0
VOS_VOID CDS_ShowIpV6FragmentBuffInfo(VOS_VOID)
{

    VOS_UINT32                         ulCnt;
    CDS_IPV6_FRAGMENT_BUFF_STRU       *pstIpv6FragBuff;
    CDS_IPV6_FRAGMENT_INFO_STRU       *pstIpv6FragInfo;

    pstIpv6FragBuff = CDS_GET_IPV6_FRAGMENT_BUFF();
    for (ulCnt = 0; ulCnt < CDS_IPV6_FRAGMENT_BUFF_SIZE; ulCnt ++)
    {
        pstIpv6FragInfo = &(pstIpv6FragBuff->astSegBuff[ulCnt]);
        vos_printf("\n IPV6 Fragment Buffer Index : %d\n",ulCnt);
        vos_printf("EPS Bearer  ID:    %d\n", pstIpv6FragInfo->ucEpsbID);
        vos_printf("IP Fragment ID:    %d\n", pstIpv6FragInfo->ulIdentity);
        vos_printf("Src IPV6 Addr :    ");
        CDS_PrintIpv6Addr(&(pstIpv6FragInfo->unSrcAddr));
        vos_printf("Dst IPV6 Addr :    ");
        CDS_PrintIpv6Addr(&(pstIpv6FragInfo->unDstAddr));
    }

    return;
}
VOS_UINT32 CDS_GetEpsbIDByIpv6FragInfo(VOS_UINT8 *pucEpsbID,
                                                const CDS_IPV6_FRAGMENT_INFO_STRU *pstSrcInfo)
{
    CDS_IPV6_FRAGMENT_BUFF_STRU     *pstIpv6FragBuff;
    CDS_IPV6_FRAGMENT_INFO_STRU     *pstFragItem;
    VOS_UINT32                       ulCnt;

    CDS_ASSERT_RTN(VOS_NULL_PTR != pstSrcInfo, PS_FAIL);
    CDS_ASSERT_RTN(VOS_NULL_PTR != pucEpsbID,  PS_FAIL);

    pstIpv6FragBuff = CDS_GET_IPV6_FRAGMENT_BUFF();
    for (ulCnt = 0; ulCnt < CDS_IPV6_FRAGMENT_BUFF_SIZE; ulCnt ++)
    {
        pstFragItem = &(pstIpv6FragBuff->astSegBuff[ulCnt]);
        if (PS_TRUE == CDS_Ipv6FragmentInfoEqual(pstFragItem,pstSrcInfo))
        {
            *pucEpsbID = pstFragItem->ucEpsbID;
            return PS_SUCC;
        }
    }

    return PS_FAIL;

}