mirror of
https://github.com/OpenEtherCATsociety/SOEM.git
synced 2026-02-06 00:53:00 +08:00
Move unmaintained ports and samples to contrib folder. Change-Id: Ie1b1a8290a0e2204b6e4e2e5c838585eb88d9e81
62 lines
1.3 KiB
C
62 lines
1.3 KiB
C
/*
|
|
* This software is dual-licensed under GPLv3 and a commercial
|
|
* license. See the file LICENSE.md distributed with this software for
|
|
* full license information.
|
|
*/
|
|
|
|
#include <sys/ioctl.h>
|
|
#include <net/if.h>
|
|
#include <sys/socket.h>
|
|
#include <arpa/inet.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
#include "oshw.h"
|
|
|
|
/**
|
|
* Host to Network byte order (i.e. to big endian).
|
|
*
|
|
* Note that Ethercat uses little endian byte order, except for the Ethernet
|
|
* header which is big endian as usual.
|
|
*/
|
|
uint16 oshw_htons(uint16 host)
|
|
{
|
|
uint16 network = htons(host);
|
|
return network;
|
|
}
|
|
|
|
/**
|
|
* Network (i.e. big endian) to Host byte order.
|
|
*
|
|
* Note that Ethercat uses little endian byte order, except for the Ethernet
|
|
* header which is big endian as usual.
|
|
*/
|
|
uint16 oshw_ntohs(uint16 network)
|
|
{
|
|
uint16 host = ntohs(network);
|
|
return host;
|
|
}
|
|
|
|
/** Create list over available network adapters.
|
|
* @return First element in linked list of adapters
|
|
*/
|
|
ec_adaptert *oshw_find_adapters(void)
|
|
{
|
|
ec_adaptert *ret_adapter = NULL;
|
|
/* Not implemented */
|
|
assert(0);
|
|
|
|
return ret_adapter;
|
|
}
|
|
|
|
/** Free memory allocated memory used by adapter collection.
|
|
* @param[in] adapter = First element in linked list of adapters
|
|
* EC_NOFRAME.
|
|
*/
|
|
void oshw_free_adapters(ec_adaptert *adapter)
|
|
{
|
|
/* Not implemented */
|
|
assert(0);
|
|
}
|