资源简介
这是个实现数据链路层6大协议的程序 ,他是用c语言编写的
代码片段和文件信息
/* Protocol 1 (utopia) provides for data transmission in one direction only from
sender to receiver. The communication channel is assumed to be error free
and the receiver is assumed to be able to process all the input infinitely quickly.
Consequently the sender just sits in a loop pumping data out onto the line as
fast as it can. */
typedef enum {frame_arrival} event_type;
#include “protocol.h“
void sender1(void)
{
frame s; /* buffer for an outbound frame */
packet buffer; /* buffer for an outbound packet */
while (true) {
from_network_layer(&buffer); /* go get something to send */
s.info = buffer; /* copy it into s for transmission */
to_physical_layer(&s); /* send it on its way */
} /* Tomorrow and tomorrow and tomorrow
Creeps in this petty pace from day to day
To the last syllable of recorded time.
- Macbeth V v */
}
void receiver1(void)
{
frame r;
event_type event; /* filled in by wait but not used here */
while (true) {
wait_for_event(&event); /* only possibility is frame_arrival */
from_physical_layer(&r); /* go get the inbound frame */
to_network_layer(&r.info); /* pass the data to the network layer */
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1247 2002-07-29 16:31 Fig-3-10.c
文件 1408 2002-07-29 16:31 Fig-3-11.c
文件 2166 2002-07-29 18:03 Fig-3-12.c
文件 2091 2002-07-29 16:31 Fig-3-14.c
文件 4185 2002-07-29 16:30 Fig-3-17.c
文件 5569 2002-07-29 18:05 Fig-3-19.c
文件 1800 2002-07-29 16:17 Fig-3-9
文件 1730 2002-07-29 17:45 Fig-5-8.c
文件 8002 2002-07-29 18:12 Fig-6-20.c
文件 1698 2002-07-29 18:06 Fig-6-6-client.c
文件 1900 2002-07-29 18:11 Fig-6-6-server.c
文件 1037 2002-07-29 18:16 Fig-8-9.c
文件 147 2002-06-12 09:33 Makefile
文件 1790 2002-07-27 14:13 protocol.h
- 上一篇:纯C语言写的打字母游戏
- 下一篇:可变分区存储管理方式的内存分配与回收(C++)
相关资源
- CCS FFT c语言算法
- 小波变换算法 c语言版
- 3des加密算法C语言实现
- DES加密算法C语言实现
- c语言看发的网络协议 ,源代码
- 线性回归算法c语言实现
- 基于C语言的模拟退火算法
- C语言实现的DES对称加密算法
- 用VC6.0实现多边形扫描线填充算法
- c语言编写的货郎担算法
- Em算法(使用C++编写)
- GD32F103 在线串口Ymodem协议升级IAP
- STM32烧写算法flash包
- Modbus协议原文-开必者实用资料
- STM32连接EC20使用内置MQTT协议接入阿里
- C语言嵌入式Modbus协议栈,支持主站和
- 永磁同步电机的FOC控制算法
- Proteus仿真:PID算法输出.rar
- 一个模糊PID温度控制算法源代码
- olsr协议代码
- 经典滤波算法
- KMP算法C语言程序
- SVM算法实现(源码+文档)
- 算法A律U律实现
- 人工蜂群算法.docx
- BlowFish加密算法
- C语言常用算法源代码
- c++数组快排算法
- 算法表达式求值.cpp
- PID算法.c
川公网安备 51152502000135号
评论
共有 条评论