Example #1
0
/*static __inline__*/static  void /*__attribute__((always_inline))*/ _ARPSetEntry(ARP_HASH_ENTRY* arpHE, ARP_ENTRY_FLAGS newFlags,
        MAC_ADDR* hwAdd, SINGLE_LIST* addList)
{
    arpHE->hEntry.flags.value &= ~ARP_FLAG_ENTRY_VALID_MASK;
    arpHE->hEntry.flags.value |= newFlags;

    if(hwAdd)
    {
        arpHE->hwAdd = *hwAdd;
    }

    arpHE->tInsert = arpTimeSeconds;
    arpHE->nRetries = 1;
    if(addList)
    {
        SingleListAddTail(addList, (SGL_LIST_NODE*)&arpHE->next);
    }
}
Example #2
0
void ANNOUNCE_Notify(TCPIP_NET_HANDLE hNet, uint8_t evType, const void * param)
{
    if(announceMemH)
    {
        ANNOUNCE_LIST_NODE* newNode = TCPIP_HEAP_Malloc(announceMemH, sizeof(*newNode));

        if(newNode)
        {
            newNode->handle = hNet;
            newNode->event = evType;
            SingleListAddTail(&announceEvents, (SGL_LIST_NODE*)newNode);
            announceEventPending = true;
            return;
        }
    }

    return;
}
Example #3
0
ARP_HANDLE ARPRegisterHandler(TCPIP_NET_HANDLE hNet, ARP_EVENT_HANDLER handler, const void* hParam)
{
    if(arpMemH)
    {
        ARP_LIST_NODE* newNode = TCPIP_HEAP_Malloc(arpMemH, sizeof(*newNode));

        if(newNode)
        {
            newNode->handler = handler;
            newNode->hParam = hParam;
            newNode->hNet = hNet;
            SingleListAddTail(&arpRegisteredUsers, (SGL_LIST_NODE*)newNode);
            return newNode;
        }
    }

    return 0;

}
Example #4
0
// re-inserts at the tail, makes the entry fresh
/*static __inline__*/static  void /*__attribute__((always_inline))*/ _ARPRefreshEntry(ARP_HASH_ENTRY* arpHE, SINGLE_LIST* pL)
{
    SingleListRemoveNode(pL, (SGL_LIST_NODE*)&arpHE->next);
    arpHE->tInsert = arpTimeSeconds;
    SingleListAddTail(pL, (SGL_LIST_NODE*)&arpHE->next);
}