get some changes
This commit is contained in:
@@ -2,12 +2,13 @@
|
|||||||
#include "xnet_tiny.h"
|
#include "xnet_tiny.h"
|
||||||
|
|
||||||
int main (void) {
|
int main (void) {
|
||||||
printf("=== xnet starting ===\n");
|
printf("xnet running\n");
|
||||||
|
// printf("=== xnet starting ===\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
xnet_init();
|
xnet_init();
|
||||||
|
|
||||||
printf("=== xnet initialized, entering main loop ===\n");
|
// printf("=== xnet initialized, entering main loop ===\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ static uint8_t driver_mac[XNET_MAC_ADDR_SIZE] = {0}; // 留空则自动读取
|
|||||||
* @return 0成功,其它失败
|
* @return 0成功,其它失败
|
||||||
*/
|
*/
|
||||||
xnet_err_t xnet_driver_open (uint8_t * mac_addr) {
|
xnet_err_t xnet_driver_open (uint8_t * mac_addr) {
|
||||||
printf("[DRIVER] Opening pcap device for IP: %s\n", ip_str);
|
// printf("[DRIVER] Opening pcap device for IP: %s\n", ip_str);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
pcap = pcap_device_open(ip_str, driver_mac, 1);
|
pcap = pcap_device_open(ip_str, driver_mac, 1);
|
||||||
@@ -26,10 +26,10 @@ xnet_err_t xnet_driver_open (uint8_t * mac_addr) {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
memcpy(mac_addr, driver_mac, XNET_MAC_ADDR_SIZE);
|
memcpy(mac_addr, driver_mac, XNET_MAC_ADDR_SIZE);
|
||||||
printf("[DRIVER] Using MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
// printf("[DRIVER] Using MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||||
driver_mac[0], driver_mac[1], driver_mac[2],
|
// driver_mac[0], driver_mac[1], driver_mac[2],
|
||||||
driver_mac[3], driver_mac[4], driver_mac[5]);
|
// driver_mac[3], driver_mac[4], driver_mac[5]);
|
||||||
printf("[DRIVER] Pcap device opened successfully\n");
|
// printf("[DRIVER] Pcap device opened successfully\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return XNET_ERR_OK;
|
return XNET_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define XLOG_LEVEL_INFO 3
|
#define XLOG_LEVEL_INFO 3
|
||||||
|
|
||||||
#ifndef XLOG_LEVEL
|
#ifndef XLOG_LEVEL
|
||||||
#define XLOG_LEVEL XLOG_LEVEL_INFO
|
#define XLOG_LEVEL XLOG_LEVEL_ERROR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if XLOG_LEVEL >= XLOG_LEVEL_INFO
|
#if XLOG_LEVEL >= XLOG_LEVEL_INFO
|
||||||
|
|||||||
Reference in New Issue
Block a user