OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [cpp/] [rawethernet.hpp] - Blame information for rev 10

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 peteralieb
// rawethernet.hpp
2
 
3
#ifndef RAWETHERNET_HPP
4
#define RAWETHERNET_HPP
5
 
6
#include <sys/socket.h>
7
#include <netpacket/packet.h>
8
#include <net/ethernet.h>
9
 
10
typedef unsigned char byte;
11
 
12
class RawEthernet
13
{
14
private:
15
        byte buffer[1514];
16
        static const byte src_mac[];
17
        int socketid;
18
        struct sockaddr_ll socket_address;
19
 
20
public:
21
        RawEthernet ();
22
        ~RawEthernet ();
23
        bool connect(byte addr[]);
24
        bool connect(struct sockaddr_ll *socket_address);
25
        void disconnect(void);
26
        bool sendData(byte data[], int len);
27
        bool requestData(int len, byte *data);
28
        short protocol;
29
};
30
 
31
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.