KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
network.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "kernel/err.h"
#include "errorcode.h"

Go to the source code of this file.

Data Structures

struct  PacketLog_s
 Packet log. More...
 

Macros

#define LOG_RX_PACKETS   32
 
#define E_NET_WRXMAC   ( E_NET + 0x01 )
 
#define E_NET_WRXMAC_DESCR   "Could not retrieve MAC"
 

Typedefs

typedef struct PacketLog_s PacketLog_t
 Packet log.
 

Functions

PacketLog_tgetPacketLog (uint32_t pos)
 Get packet log at position pos. More...
 
void resetPacketLog ()
 Reset the packet log. More...
 
bool netInit ()
 Initializes the network.
 
bool netMuxDest (uint32_t destIp, uint16_t *destMac)
 Sets the IPMux destination. More...
 
void netShowInfo (bool extended)
 Shows network configuration information. More...
 
void netSetIp (uint8_t *ip)
 Sets the Ip address to the network. More...
 
uint32_t netEventFailedCount ()
 Returns the number of events failed to be transmitted since the the function was previously invoked. More...
 
bool netIpValid ()
 Returns whether or not the Ip is valid. More...
 

Function Documentation

PacketLog_t* getPacketLog ( uint32_t  pos)

Get packet log at position pos.

Maximum is LOG_RX_PACKTS.

Returns
A PacketLog_t pointer for the given position, or NULL if the packet log is not enabled or there is no packet logged at that location.

Definition at line 71 of file network.c.

uint32_t netEventFailedCount ( )

Returns the number of events failed to be transmitted since the the function was previously invoked.

Calling this function will also reset the function counter.

Returns
The number of transmission failures.

Definition at line 667 of file network.c.

bool netIpValid ( )

Returns whether or not the Ip is valid.

Return values
trueIts valid
falseIts not valid.

Definition at line 677 of file network.c.

bool netMuxDest ( uint32_t  destIp,
uint16_t *  destMac 
)

Sets the IPMux destination.

Parameters
destIPDestination IP
destMACDestinaion Mac

Definition at line 361 of file network.c.

void netSetIp ( uint8_t *  ip)

Sets the Ip address to the network.

Parameters
ipThe new IP addresss.

Definition at line 475 of file network.c.

void netShowInfo ( bool  extended)

Shows network configuration information.

Parameters
extendedshow extended information.

Definition at line 541 of file network.c.

void resetPacketLog ( )

Reset the packet log.

Will cause the packet buffer to be filled again up to LOG_RX_PACKETS packets.

Definition at line 77 of file network.c.