2020-05-06 23:33:32 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <errno.h>
|
2020-05-07 03:57:01 +02:00
|
|
|
#include "umka.h"
|
2020-05-06 23:33:32 +02:00
|
|
|
#include "trace.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned x;
|
|
|
|
} vnet_t;
|
|
|
|
|
|
|
|
void *vnet_init() {
|
2020-05-07 03:08:20 +02:00
|
|
|
printf("vnet_init\n");
|
2020-05-06 23:33:32 +02:00
|
|
|
vnet_t *vnet = (vnet_t*)malloc(sizeof(vnet_t));
|
|
|
|
*vnet = (vnet_t){.x = 0,};
|
|
|
|
return vnet;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((__stdcall__))
|
|
|
|
void vnet_unload() {
|
2020-05-07 03:08:20 +02:00
|
|
|
printf("vnet_unload\n");
|
2020-05-06 23:33:32 +02:00
|
|
|
COVERAGE_OFF();
|
|
|
|
COVERAGE_ON();
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((__stdcall__))
|
|
|
|
void vnet_reset() {
|
2020-05-07 03:08:20 +02:00
|
|
|
printf("vnet_reset\n");
|
2020-05-06 23:33:32 +02:00
|
|
|
COVERAGE_OFF();
|
|
|
|
COVERAGE_ON();
|
|
|
|
}
|
|
|
|
|
2020-05-07 03:08:20 +02:00
|
|
|
static void dump_net_buff(net_buff_t *buf) {
|
|
|
|
for (size_t i = 0; i < buf->length; i++) {
|
|
|
|
printf("%2.2x ", buf->data[i]);
|
|
|
|
}
|
|
|
|
putchar('\n');
|
|
|
|
}
|
|
|
|
|
2020-05-06 23:33:32 +02:00
|
|
|
__attribute__((__stdcall__))
|
2020-05-07 03:08:20 +02:00
|
|
|
void vnet_transmit(net_buff_t *buf) {
|
|
|
|
printf("vnet_transmit: %d bytes\n", buf->length);
|
|
|
|
dump_net_buff(buf);
|
2020-05-06 23:33:32 +02:00
|
|
|
COVERAGE_OFF();
|
|
|
|
COVERAGE_ON();
|
|
|
|
}
|
|
|
|
|