udp.h

来自「mcu_PPP.rar是在M68HC08单片机上编写的TCP/IP协议程序.实现」· C头文件 代码 · 共 43 行

H
43
字号
/*/////////////////////////////////////////////////////////////////////////////

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 *data, 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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?