io.c

来自「操作系统源代码」· C语言 代码 · 共 29 行

C
29
字号
/*io.c*/#include <stdlib.h>#include "inet.h"#include "io.h"PUBLIC void writeIpAddr(addr)ipaddr_t addr;{	u8_t *addrInBytes;	addrInBytes= (u8_t *)&addr;	printf("%d.%d.%d.%d", addrInBytes[0], addrInBytes[1],		addrInBytes[2], addrInBytes[3]);}PUBLIC void writeEtherAddr(addr)ether_addr_t *addr;{	u8_t *addrInBytes;	addrInBytes= (u8_t *)(addr->ea_addr);	printf("%x:%x:%x:%x:%x:%x", addrInBytes[0], addrInBytes[1],		addrInBytes[2], addrInBytes[3], addrInBytes[4], addrInBytes[5]);}

⌨️ 快捷键说明

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