1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

iec61850: fix ether_aton() call on OS X

This commit is contained in:
Steffen Vogel 2018-06-25 06:01:47 +02:00
parent 58a13ae92e
commit 34e6891192
3 changed files with 13 additions and 3 deletions

View file

@ -31,6 +31,12 @@
#include <stdint.h>
#ifdef __APPLE__
#include <net/ethernet.h>
#else
#include <netinet/ether.h>
#endif
#include <libiec61850/hal_ethernet.h>
#include <libiec61850/goose_receiver.h>
#include <libiec61850/sv_subscriber.h>

View file

@ -25,7 +25,6 @@
#include <string.h>
#include <pthread.h>
#include <unistd.h>
#include <netinet/ether.h>
#include "villas/nodes/iec61850_sv.h"
#include "villas/plugin.h"

View file

@ -27,7 +27,6 @@
#include <string.h>
#include <pthread.h>
#include <unistd.h>
#include <netinet/ether.h>
#include "villas/nodes/iec61850_sv.h"
#include "villas/plugin.h"
@ -166,8 +165,14 @@ int iec61850_sv_parse(struct node *n, json_t *json)
if (interface)
i->interface = strdup(interface);
if (dst_address)
if (dst_address) {
#ifdef __APPLE__
struct ether_addr *ether = ether_aton(dst_address);
memcpy(&i->dst_address, ether, sizeof(struct ether_addr));
#else
ether_aton_r(dst_address, &i->dst_address);
#endif
}
if (json_pub) {
i->publisher.enabled = true;