Files
stopwait_chat_ipv6/common.h
2025-12-26 14:32:15 +08:00

23 lines
389 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef COMMON_H
#define COMMON_H
#include <stdint.h>
#define TYPE_DATA 0
#define TYPE_ACK 1
#define PORT 9000
#define BUF_SIZE 1024
#define TIMEOUT_SEC 2
/* 应用层协议数据包 */
#pragma pack(push, 1)
struct packet {
uint8_t seq; // 停等协议序号0 / 1
uint8_t type; // 0=DATA, 1=ACK
char payload[BUF_SIZE - 2];
};
#pragma pack(pop)
#endif