// $Id: adapter.h,v 1.8 2011/02/18 22:31:09 lpoulsen Exp $
//
// Copyright (c) 2008 by Afar Communications Inc, Santa Barbara, CA 93117 USA
// Copyright (C) 2001 Wi_LAN Technologies, Inc
//
// adapter.h - module interfaces for ECON's adapter module
//
// $Log: adapter.h,v $
// Revision 1.8  2011/02/18 22:31:09  lpoulsen
// Add "adapter" command to switch to another ethernet port
//
// Revision 1.7  2011/02/08 01:19:54  lpoulsen
// Abandoned econ98 (windows_adapter.c)
//
// Revision 1.6  2010/12/22 17:36:33  lpoulsen
// Select/Deselect list of ranges
// Expand to up to 511 radios
// Protocol fixes
//
// Revision 1.5  2008/05/10 01:17:37  lpoulsen
// Making econ -x filename work (not yet complete)
//
// Revision 1.4  2003/12/17 18:19:08  lpoulsen
// Respond to IDENTIFY_REQUEST (to support "show econ" on radio/mux)
//
// Revision 1.3  2001/10/30 01:07:45  lpoulsen
// Add "module ID" statement, audit trail generator and copyright line
// Remove "win_or_linux.h" and use a -D in Linux makefile instead.
//
//

#define Max_Num_Adapter 11

struct adapter_struct {
    ip_addr ip_addr;
    uint8   mac_addr[6];
    uint16  flags;
#define     EA_VALID    1
#define     EA_IP_ADDR  2
#define     EA_MAC_ADDR 4
#define     EA_USABLE   8
    char    name[80];
    char    desc[80];
};

extern struct adapter_struct ethernet_adapters[Max_Num_Adapter+1];

unsigned char *allMACs[8];
extern macAddr bcastMacAddress;
unsigned char  lMACDefinition[6];
extern char    localHostName[];
extern ipAddr  my_ip_address;
extern macAddr my_mac_address;
int            numOfMACs;

extern int adapter_send(BYTE * packet_to_send, int packet_size);
extern int adapter_receive(unsigned char *packet);
extern int find_adapters(boolean list);
extern int open_adapter(int index);
extern int get_adapters();         // combines find_adapters(true)
                                   //     with open_adapter(option_C)
extern int close_all_adapters();
