protocol1.h

来自「本人本科的毕业设计。基于Serpent密码的回退N协议的数据传输。希望可供大家参」· C头文件 代码 · 共 42 行

H
42
字号
typedef enum {data, ack, nak} frame_kind;	/* frame_kind definition */typedef struct frame{	/* frames are transported in this layer */
// frame_kind kind;	/* what kind of a frame is it? */
 frame_kind frameType;
 unsigned int seq;   	/* sequence number */
// seq_nr ack;   	/* acknowledgement number */
 unsigned long info;  	/* the network layer packet */
} pFrame;/* Wait for an event to happen; return its type in event. *//*void wait_for_event(event_type *event);*/struct param{
	CEdit* pEdit;
    DWORD dwIP;
};
/* Go get an inbound frame from the physical layer and copy it to r. */void from_physical_layer(frame *r);/* Pass the frame to the physical layer for transmission. */void to_physical_layer(frame *s);/* Start the clock running and enable the timeout event. *///void start_timer(seq_nr k);/* Stop the clock and disable the timeout event. *///void stop_timer(seq_nr k);/* Start an auxiliary timer and enable the ack_timeout event. *///void start_ack_timer(void);/* Stop the auxiliary timer and disable the ack_timeout event. *///void stop_ack_timer(void);/* Allow the network layer to cause a network_layer_ready event. */void enable_network_layer(void);/* Forbid the network layer from causing a network_layer_ready event. */void disable_network_layer(void);/* Macro inc is expanded in-line: Increment k circularly. */#define inc(k) if (k < MAX_SEQ) k = k + 1; else k = 0

⌨️ 快捷键说明

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