File: linux_eth.h

package info (click to toggle)
dynamips 0.2.7-0.2.8RC2-2
  • links: PTS
  • area: non-free
  • in suites: lenny
  • size: 3,840 kB
  • ctags: 9,893
  • sloc: ansic: 69,846; makefile: 239; sh: 124; perl: 20
file content (27 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Copyright (c) 2006 Christophe Fillot.
 * E-mail: cf@utc.fr
 *
 * linux_eth.c: module used to send/receive Ethernet packets.
 *
 * Specific to the Linux operating system.
 */

#ifndef __LINUX_ETH_H__
#define __LINUX_ETH_H__  1

#include <sys/types.h>

/* Get interface index of specified device */
int lnx_eth_get_dev_index(char *name);

/* Initialize a new ethernet raw socket */
int lnx_eth_init_socket(char *device);

/* Send an ethernet frame */
ssize_t lnx_eth_send(int sck,int dev_id,char *buffer,size_t len);

/* Receive an ethernet frame */
ssize_t lnx_eth_recv(int sck,char *buffer,size_t len);

#endif