libIEC61850  0.8.0
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ethernet.h
Go to the documentation of this file.
1 /*
2  * ethernet.h
3  *
4  * Copyright 2013 Michael Zillgith
5  *
6  * This file is part of libIEC61850.
7  *
8  * libIEC61850 is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * libIEC61850 is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * See COPYING file for the complete license text.
22  */
23 
24 #ifndef ETHERNET_H_
25 #define ETHERNET_H_
26 
27 #include <stdint.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
48 typedef struct sEthernetSocket* EthernetSocket;
49 
58 void
59 Ethernet_getInterfaceMACAddress(char* interfaceId, uint8_t* addr);
60 
68 EthernetSocket
69 Ethernet_createSocket(char* interfaceId, uint8_t* destAddress);
70 
71 void
72 Ethernet_destroySocket(EthernetSocket ethSocket);
73 
74 void
75 Ethernet_sendPacket(EthernetSocket ethSocket, uint8_t* buffer, int packetSize);
76 
77 void
78 Ethernet_setProtocolFilter(EthernetSocket ethSocket, uint16_t etherType);
79 
80 int
81 Ethernet_receivePacket(EthernetSocket self, uint8_t* buffer, int bufferSize);
82 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* ETHERNET_H_ */