XINU
arp_dump.c
Go to the documentation of this file.
1 
8 #include <xinu.h>
9 
10 /*------------------------------------------------------------------------
11  * arp_dump - Display the contents of an RP cache entry
12  *------------------------------------------------------------------------
13  */
14 void arp_dump(
15  struct arpentry *arptr /* Pointer to ARP cache entry */
16 )
17 {
18  int32 i; /* Index for a MAC address */
19 
20  kprintf("State=%d, PID=%d IP=%08x, HW=", arptr->arstate,
21  arptr->arpid, arptr->arpaddr);
22  kprintf(" %02X", arptr->arhaddr[0]);
23  for (i = 1; i < ARP_HALEN; i++)
24  {
25  printf(":%02X", arptr->arhaddr[i]);
26  }
27  kprintf("\n");
28  return;
29 }
syscall kprintf(char *fmt,...)
ポーリングI/Oを使用して、フォーマットされた文字列をコンソールに出力する。
Definition: kprintf.c:98
全てのシステムヘッダファイルをインクルードする。
int32 printf(const char *,...)
Definition: printf.c:13
int32 arstate
エントリの状態
Definition: arp.h:75
uint32 arpaddr
エントリのIPアドレス
Definition: arp.h:77
void arp_dump(struct arpentry *arptr)
Definition: arp_dump.c:14
#define ARP_HALEN
EthernetのMACアドレスサイズ
Definition: arp.h:8
ARPキャッシュエントリ
Definition: arp.h:72
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
byte arhaddr[ARP_HALEN]
エントリのEthernetアドレス
Definition: arp.h:81
pid32 arpid
待機中プロセスか-1
Definition: arp.h:79