Translated all files to ENG (#5)
Reviewed-on: #5 Co-authored-by: Finn <fwaggoner@nmfpgt.de> Co-committed-by: Finn <fwaggoner@nmfpgt.de>
This commit was merged in pull request #5.
This commit is contained in:
+9
-9
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* openuf - main.c
|
||||
*
|
||||
* Daemon principal. Bucle con tres tareas:
|
||||
* 1. Announce – UDP broadcast+multicast cada 10s (descubrimiento L2)
|
||||
* 2. Inform – HTTP POST cifrado cada 10s (adopción + telemetría)
|
||||
* 3. LLDP – Raw frame L2 cada 30s (topología visual en UniFi)
|
||||
* Main daemon. Loop with three tasks:
|
||||
* 1. Announce – UDP broadcast+multicast each 10s (discovery L2)
|
||||
* 2. Inform – HTTP POST cifrado each 10s (adoption + telemetrics)
|
||||
* 3. LLDP – Raw frame L2 each 30s (visual topology in UniFi)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -127,13 +127,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Descripción LLDP del dispositivo ───────────────────────── */
|
||||
/* ── LLDP device description ───────────────────────── */
|
||||
char lldp_desc[128];
|
||||
snprintf(lldp_desc, sizeof(lldp_desc),
|
||||
"%s %s%s (openuf)",
|
||||
model->model_display, model->fw_pre, model->fw_ver);
|
||||
|
||||
/* ── Bucle principal ─────────────────────────────────────────── */
|
||||
/* ── Main loop ─────────────────────────────────────────── */
|
||||
time_t start_time = time(NULL);
|
||||
time_t last_announce = 0;
|
||||
time_t last_inform = 0;
|
||||
@@ -154,12 +154,12 @@ int main(int argc, char *argv[])
|
||||
last_announce = now;
|
||||
}
|
||||
|
||||
/* LLDP frames por cada interfaz ethernet */
|
||||
/* LLDP frames for each Ethernet interface */
|
||||
if ((now - last_lldp) >= LLDP_INTERVAL) {
|
||||
LOG("Sending LLDP frames");
|
||||
for (int i = 0; i < model->port_table_len; i++) {
|
||||
const char *iface = model->port_table[i].ifname;
|
||||
/* Leer MAC real de la interfaz si disponible */
|
||||
/* Read the actual MAC of the interface if available */
|
||||
char iface_mac[32];
|
||||
if (get_mac(iface, iface_mac, sizeof(iface_mac)) != 0)
|
||||
strncpy(iface_mac, mac_str, sizeof(iface_mac)-1);
|
||||
@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
|
||||
last_inform = now;
|
||||
LOG("Sending inform");
|
||||
|
||||
/* Actualizar IP en cada ciclo */
|
||||
/* Update IP each cycle */
|
||||
char new_ip[64] = {0};
|
||||
if (get_ip(cfg.lan_if, new_ip, sizeof(new_ip)) == 0 ||
|
||||
get_ip("eth0", new_ip, sizeof(new_ip)) == 0)
|
||||
|
||||
Reference in New Issue
Block a user