1 |
/* |
2 |
* Copyright (c) 2006 Christophe Fillot. |
3 |
* E-mail: cf@utc.fr |
4 |
* |
5 |
* linux_eth.c: module used to send/receive Ethernet packets. |
6 |
* |
7 |
* Specific to the Linux operating system. |
8 |
*/ |
9 |
|
10 |
#ifndef __LINUX_ETH_H__ |
11 |
#define __LINUX_ETH_H__ 1 |
12 |
|
13 |
#include <sys/types.h> |
14 |
|
15 |
/* Get interface index of specified device */ |
16 |
int lnx_eth_get_dev_index(char *name); |
17 |
|
18 |
/* Initialize a new ethernet raw socket */ |
19 |
int lnx_eth_init_socket(char *device); |
20 |
|
21 |
/* Send an ethernet frame */ |
22 |
ssize_t lnx_eth_send(int sck,int dev_id,char *buffer,size_t len); |
23 |
|
24 |
/* Receive an ethernet frame */ |
25 |
ssize_t lnx_eth_recv(int sck,char *buffer,size_t len); |
26 |
|
27 |
#endif |