#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <net/ethernet.h>
#include <syscall.h>
#include <sys/nic.h>
Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
Definition at line 40 of file ethinject.c.
41{
44
45 printf(
"Ethernet Dump Tool\n");
46
50 return 1;
51 }
52
53 printf(
"Injecting packet on nic%d\n", (
int)nic.
nicNo);
54
62
69
70 while (1) {
73 }
74}
uint8_t ether_shost[ETHER_ADDR_LEN]
uint8_t ether_dhost[ETHER_ADDR_LEN]
void writePacket(NIC *nic)
int OSNICStat(uint64_t nicNo, NIC *nic)
int printf(const char *fmt,...)
unsigned int sleep(unsigned int seconds)
◆ writePacket()
void writePacket |
( |
NIC * |
nic | ) |
|
Definition at line 16 of file ethinject.c.
17{
19
26
28 if (status != 0) {
29 printf(
"OSNICSend failed!\n");
30 return;
31 }
32
34 printf(
"Failed to write packet!\n");
35 return;
36 }
37}
int OSNICSend(uint64_t nicNo, MBuf *mbuf)
#define MBUF_STATUS_FAILED
◆ buf
◆ mbuf
◆ nicNo