www.pudn.com > pppcode.rar > udp.h


/*///////////////////////////////////////////////////////////////////////////// 
File Name : UDP.h 
Author : Rene Trenado 
Location : Motorola Applications Lab, Baja California 
Date Created : December 2001 
Current Revision : 0.0 
Notes : This file contains definitions needed by the UDP module. 
//////////////////////////////////////////////////////////////////////////////*/ 
#ifndef __UDP_H 
#define __UDP_H 
#include "notation.h" 
typedef struct { 
BYTE SourceIP [4]; 
BYTE DestinationIP [4]; 
WORD SourcePort; 
WORD DestPort; 
BYTE LengthUpper; 
BYTE Length; 
WORD Checksum; 
BYTE Payload[54]; 
} UDPDatagram; 
extern UDPDatagram *udp_out; 
typedef void (*UDPCALLBACK)(BYTE *udpdata, BYTE size, DWORD RemoteIP, WORD Port); 
void UDPSetCALLBACK (UDPCALLBACK Proc); 
void UDP_Handler (UDPDatagram *udp); 
WORD UDP_Checksum (BYTE* udp); 
void UDPBind (WORD Port); 
void UDPSendData (BYTE Ip[], WORD Port, BYTE* Payload, BYTE size); 
#endif