udp.h

来自「s3c2410下的tftp固件程序」· C头文件 代码 · 共 26 行

H
26
字号
#ifndef _UDP_H
#define _UDP_H

#include "types.h"

/* UDP protocol header struct */
struct UDPHDR
{
    USHORT uh_sport;   			/* Source port 		*/
    USHORT uh_dport;   			/* Destination port */
    USHORT uh_ulen;    			/* UDP length 		*/
    USHORT uh_sum;     			/* UDP checksum 	*/
}__attribute__((packed));

/* max_len -- buffer size which pDataBuffer pointer */
extern int UdpInput(USHORT port, USHORT tms, char* pDataBuffer, int max_len);

/* dip   -- destination ip address
   dport -- destination UDP port
   sport -- source UPD port
   pData -- data pointer
   len   -- data len (must no more than 1024 bytes) */
extern int UdpOutput(ULONG dip, USHORT dport, USHORT sport, char *pData, USHORT len);

#endif /* _UDP_H */

⌨️ 快捷键说明

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