aoe
87
About: AoE (ATA over Ethernet) Protocol Driver (Linux kernel 4.8.x and greater are not supported).
![]() ![]() |
#include <stdio.h>
#include <sched.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <time.h>
#include <sys/ioctl.h>
#include <pthread.h>
#include <poll.h>
#include <errno.h>
#include <netpacket/packet.h>
#include <net/ethernet.h>
#include <sys/types.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
Go to the source code of this file.
Data Structures | |
struct | Aoe |
struct | Qc |
struct | Ata |
struct | Lun |
struct | Eth |
struct | Targ |
struct | Mac |
Macros | |
#define | nelem(x) (sizeof(x)/sizeof((x)[0])) |
#define | nil NULL |
#define | vprintf(...) if (qflag) ; else fprintf(stderr, __VA_ARGS__) |
#define | mintu(x) ((x) > 60 ? x : 60) |
Typedefs | |
typedef unsigned char | uchar |
typedef unsigned long | ulong |
typedef struct Aoe | Aoe |
typedef struct Qc | Qc |
typedef struct Ata | Ata |
typedef struct Lun | Lun |
typedef struct Eth | Eth |
typedef struct Targ | Targ |
typedef struct Mac | Mac |
Enumerations | |
enum | { Neth = 16, Nstack = 16*1024, Nws = 5, Lnew = 0, Lprobe, Arsp = (1<<3), Aerr = (1<<2), Cata = 0, Cqc = 1, ETaoe = 0x88a2 } |
Functions | |
int | ethlist (char **, int) |
int | ethopen (Eth *) |
void * | jcheck (void *) |
int | jinput (Eth *) |
Lun * | findlun (Eth *e, Aoe *a) |
void | jprobe (Eth *e, Lun *lun) |
void | printlist (void) |
void | printsancheck (void) |
ulong | nhgetl (uchar *) |
ushort | nhgets (uchar *) |
void | hnputs (uchar *, ushort) |
void | hnputl (uchar *, ulong) |
void * | mallocz (int) |
void | inserttarg (int, int) |
void | insertmac (Mac **, char *) |
void | sancheck (int, int) |
void | ifsummary (void) |
int | ifup (char *) |
void | inserteth (char **, int, char *) |
char * | getpciid (char *, int, char *) |
int | main (int argc, char **argv) |
char * | cea (char *op, char *ea) |
void | timewait (int secs) |
int | discover (Eth *e) |
void | catch (int sig) |
int | getindx (int sfd, char *name) |
int | getmtu (Eth *e) |
Variables | |
Eth | eth [Neth] |
int | waitsecs = Nws |
pthread_t | threads [Neth] |
Targ * | targlist |
#define mintu | ( | x | ) | ((x) > 60 ? x : 60) |
Definition at line 27 of file aoe-sancheck.c.
#define nelem | ( | x | ) | (sizeof(x)/sizeof((x)[0])) |
Definition at line 24 of file aoe-sancheck.c.
#define nil NULL |
Definition at line 25 of file aoe-sancheck.c.
#define vprintf | ( | ... | ) | if (qflag) ; else fprintf(stderr, __VA_ARGS__) |
Definition at line 26 of file aoe-sancheck.c.
Definition at line 32 of file aoe-sancheck.c.
Definition at line 34 of file aoe-sancheck.c.
Definition at line 36 of file aoe-sancheck.c.
Definition at line 35 of file aoe-sancheck.c.
Definition at line 38 of file aoe-sancheck.c.
Definition at line 33 of file aoe-sancheck.c.
Definition at line 37 of file aoe-sancheck.c.
typedef unsigned char uchar |
Definition at line 29 of file aoe-sancheck.c.
typedef unsigned long ulong |
Definition at line 30 of file aoe-sancheck.c.
anonymous enum |
Enumerator | |
---|---|
Neth | |
Nstack | |
Nws | |
Lnew | |
Lprobe | |
Arsp | |
Aerr | |
Cata | |
Cqc | |
ETaoe |
Definition at line 105 of file aoe-sancheck.c.
void catch | ( | int | sig | ) |
Definition at line 428 of file aoe-sancheck.c.
char* cea | ( | char * | op, |
char * | ea | ||
) |
Definition at line 179 of file aoe-sancheck.c.
Referenced by printlist(), and sancheck().
Definition at line 222 of file aoe-sancheck.c.
References Aoe::cmd, Cqc, Aoe::dst, Eth::ea, ETaoe, Eth::fd, Aoe::flags, hnputl(), hnputs(), Aoe::major, Aoe::minor, mintu, Eth::pkt, Aoe::src, Aoe::tag, and Aoe::type.
Referenced by jcheck().
Definition at line 390 of file aoe-sancheck.c.
References Cata, Aoe::cmd, Lun::ea, Lun::id, inserttarg(), Eth::luns, Aoe::major, Lun::major, mallocz(), Aoe::minor, Lun::minor, Lun::next, nhgets(), nil, and Aoe::src.
Referenced by jinput().
Definition at line 446 of file aoe-sancheck.c.
References Eth::fd, and Eth::name.
Referenced by ethopen().
char * getpciid | ( | char * | b, |
int | blen, | ||
char * | n | ||
) |
Definition at line 743 of file aoe-sancheck.c.
Referenced by ifsummary().
Definition at line 319 of file aoe-sancheck.c.
Referenced by discover(), and jprobe().
void hnputs | ( | uchar * | p, |
ushort | s | ||
) |
Definition at line 328 of file aoe-sancheck.c.
Referenced by discover(), and jprobe().
void ifsummary | ( | void | ) |
Definition at line 593 of file aoe-sancheck.c.
References eth, getpciid(), Eth::mtu, Eth::name, and Eth::up.
Referenced by printsancheck().
int ifup | ( | char * | ethname | ) |
Definition at line 692 of file aoe-sancheck.c.
Referenced by main().
void inserteth | ( | char ** | ifs, |
int | nifs, | ||
char * | n | ||
) |
Definition at line 712 of file aoe-sancheck.c.
Referenced by ethlist().
void insertmac | ( | Mac ** | ml, |
char * | m | ||
) |
Definition at line 676 of file aoe-sancheck.c.
References Mac::ea, mallocz(), and Mac::next.
Referenced by sancheck().
Definition at line 536 of file aoe-sancheck.c.
References Targ::major, mallocz(), Targ::minor, Targ::next, and targlist.
Referenced by findlun().
void * jcheck | ( | void * | v | ) |
Definition at line 243 of file aoe-sancheck.c.
References discover(), ethopen(), Eth::fd, jinput(), Eth::name, Eth::pkt, and waitsecs.
Referenced by main().
Definition at line 273 of file aoe-sancheck.c.
References Aerr, Arsp, Cata, Aoe::cmd, Cqc, findlun(), Aoe::flags, Lun::id, jprobe(), Lnew, Lprobe, Lun::major, Lun::maxsect, Lun::minor, nhgetl(), nil, Lun::nsect, Eth::pkt, Qc::scnt, Lun::state, and Aoe::tag.
Referenced by jcheck().
Definition at line 361 of file aoe-sancheck.c.
References Ata::cmd, Aoe::dst, Lun::ea, Eth::ea, ETaoe, Eth::fd, Aoe::flags, hnputl(), hnputs(), Lun::id, Aoe::major, Lun::major, Aoe::minor, Lun::minor, Eth::mtu, Eth::pkt, Ata::scnt, Aoe::src, Aoe::tag, and Aoe::type.
Referenced by jinput().
Definition at line 149 of file aoe-sancheck.c.
References eth, ethlist(), ifup(), jcheck(), Eth::name, nelem, Neth, printlist(), printsancheck(), threads, and Eth::up.
void * mallocz | ( | int | sz | ) |
Definition at line 526 of file aoe-sancheck.c.
Referenced by findlun(), insertmac(), and inserttarg().
Definition at line 346 of file aoe-sancheck.c.
Referenced by jinput().
ushort nhgets | ( | uchar * | p | ) |
Definition at line 335 of file aoe-sancheck.c.
Referenced by findlun().
void printlist | ( | void | ) |
Definition at line 194 of file aoe-sancheck.c.
References cea(), Lun::ea, eth, Eth::luns, mac, Lun::major, Lun::maxsect, Lun::minor, Eth::name, and Lun::next.
Referenced by main().
void printsancheck | ( | void | ) |
Definition at line 574 of file aoe-sancheck.c.
References ifsummary(), Targ::major, Targ::minor, Targ::next, sancheck(), and targlist.
Referenced by main().
Definition at line 607 of file aoe-sancheck.c.
References cea(), Lun::ea, eth, insertmac(), Eth::luns, mac, Lun::major, Lun::maxsect, Lun::minor, Eth::mtu, Eth::name, Lun::next, Mac::next, and Lun::nsect.
Referenced by printsancheck().
void timewait | ( | int | secs | ) |
Definition at line 209 of file aoe-sancheck.c.
Definition at line 143 of file aoe-sancheck.c.
Referenced by dial(), ifsummary(), main(), printlist(), and sancheck().
Targ* targlist |
Definition at line 146 of file aoe-sancheck.c.
Referenced by inserttarg(), and printsancheck().
pthread_t threads[Neth] |
Definition at line 145 of file aoe-sancheck.c.
Referenced by main().
Definition at line 144 of file aoe-sancheck.c.
Referenced by jcheck().