src/stack/raweth/raweth.c File Reference

The file implements the interface to send and receive Raw Ethernet traffic using NDK stack and NIMU architecture. More...


Functions

int RawEthTxPacket (HANDLE hRawEthSock, char *pBuffer, int len)
int RawEthTxPacketNC (HANDLE hRawEthSock, char *pBuffer, int len, HANDLE hPkt)
int RawEthRxPacket (PBM_Handle hPkt)


Detailed Description

The file implements the interface to send and receive Raw Ethernet traffic using NDK stack and NIMU architecture.

NOTE: (C) Copyright 2008, Texas Instruments, Inc.

Function Documentation

int RawEthRxPacket ( PBM_Handle  hPkt  ) 

Description
This routine is the API interface routine which is called by the NIMU layer when the ethernet type doesnt match any of the well know standard ethernet types. This function checks if a raw ethernet socket object exists for the ethernet type in the packet and if so enqueus in the socket buffer for the application to receive.

Parameters:
[in] hPkt Handle to the packet which is to be passed up the NDK stack.
Return values:
-1 - Error
0 - Success

int RawEthTxPacket ( HANDLE  hRawEthSock,
char *  pBuffer,
int  len 
)

Description
The function is the interface routine which is called to send a packet via a raw ethernet socket object.

Parameters:
[in] hRawEthSock Handle to the Raw ethernet socket.
[in] pBuffer Handle to the data buffer that needs to be sent
[in] len length of the data
Return values:
0 - Successfully sent out the packet. ENOBUFS - Error allocating memory for the packet. Packet not sent out.

int RawEthTxPacketNC ( HANDLE  hRawEthSock,
char *  pBuffer,
int  len,
HANDLE  hPkt 
)

Description
The function is the interface routine which is called to send a packet without any copy via a raw ethernet socket object.

Parameters:
[in] hRawEthSock Handle to the Raw ethernet socket.
[in] pBuffer Handle to the data buffer that needs to be sent
[in] len length of the data
[in] hPkt Handle to the packet that needs to be sent
Return values:
0 - Successfully sent out the packet. EINVAL - Bad Packet / Buffer handles, packet not sent out.


Copyright 2009, Texas Instruments Incorporated