|
Data Structures |
struct | mac_promisc_recv_frame_info |
| Structure, to store per-packet information between the callback function of pcap_loop and mac_promisc_recv. More...
|
struct | mac_recv_frame_info |
| Structure, to store per-packet information between the callback function of pcap_loop and mac_recv. More...
|
struct | mac_ifinfo_list |
| Linked list containing structures, as members, for existing interfaces. More...
|
struct | mac_ifinfo |
| Structure, containing a linked list and a version number field, as members. More...
|
struct | mac_params |
| Structure, to implement the parameters as key-value pairs. More...
|
struct | mac_params_flags |
| Structure, to implement what the application wants to do (set/get/append/receive), with regards to the parameters, using flag variables. More...
|
Defines |
#define | DEBUG_ERR |
| Debug macro. Always present.
|
#define | DEBUG_BASIC |
| Debug macro. Higher level of debugging.
|
#define | USE_PROC_INTERFACE_OK 0 |
| Macro that says that use of proc interface is allowed. If not defined, then ioctl is used to setting txpower as well.
|
#define | IFNAME 8 |
| Constant name for size of interface.
|
#define | IPSIZE 16 |
| Constant name for size of IP address.
|
#define | MACSIZE 6 |
| Constant name for size of MAC address.
|
#define | VERSION 1.2 |
| Current version # of this library.
|
#define | FRM_TYPE 0x0900 |
| WINLAB frame type.
|
#define | MAX_FRAME_SIZE 1500 |
| Libnet-restricted max. frame size.
|
#define | IOCTL_BUF_SIZE 1024 |
| IOCTL Buffer size. Used by the ioctl that obtains basic information on all interfaces.
|
#define | PROC_BUF_SIZE 128 |
| Buffer size used to store command that is passed to system call for setting txpower parameter.
|
#define | SET 0 |
| Constant that results in flag bits being set, defined for the mode1 byte in the mac_params_setflags function.
|
#define | RESET 1 |
| Constant that results in flag bits being reset, defined for the mode1 byte in the mac_params_setflags function.
|
#define | GET_FLAG 0 |
| Constant that results in the get_flag bits being set/reset, defined for the mode2 byte in the mac_params_setflags function.
|
#define | SET_FLAG 1 |
| Constant that results in the set_flag bits being set/reset, defined for the mode2 byte in the mac_params_setflags function.
|
#define | APPEND_FLAG 2 |
| Constant that results in the append_flag bits being set/reset, defined for the mode2 byte in the mac_params_setflags function.
|
#define | INCLUDE_FLAG 3 |
| Constant that results in flag bits of include_flag, being set/reset, defined for the mode2 byte in the mac_params_setflags function.
|
#define | CHANGE_FLAG 4 |
| Constant that results in flag bits of change_flag, being set/reset, defined for the mode2 byte in the mac_params_setflags function.
|
#define | OUTGOING 0 |
| Constant that results in parameters being appended to all outgoing frames, defined for direction byte in the mac_append_params function.
|
#define | INCOMING 1 |
| Constant that results in parameters being appended to all incoming frames, defined for direction byte in the mac_append_params function.
|
#define | APPEND_OFF 2 |
| Constant that results in the stopping of parameter-appending to all frames.
|
#define | INIT_VAL -1 |
| Constant that is the value to which all <key, value> pairs are initialized.
|
#define | UNSUPPORTED INT_MIN |
| Constant that is the value to which the value, corresponding to a key, is set, in the mac_set_params function, in case the parameter is not supported.
|
#define | READONLY INT_MAX |
| Constant that is the value to which the value, corresponding to a key, is set, in the mac_set_params function, in case the parameter is read-only.
|
#define | SIZEOF_PARAMS_LIST_LEN sizeof(char) |
| Constant that indicates the size, in bytes, of the length field that is prepended to the parameter information.
|
#define | SIZEOF_PARAMS_LIST_KEY sizeof(char) |
| Constant that indicates the size, in bytes, of the key field in the parameter information that is appended.
|
#define | SIZEOF_PARAMS_LIST_VALUE sizeof(unsigned short) |
| Constant that indicates the size, in bytes, of the value field in the parameter information that is appended.
|
#define | BYTE_SIZE_MAX_16b_VALUE 5 |
| Constant that represents the size in bytes of the maximum 16-bit value (65535).
|
Functions |
int | mac_get_ifinfo (struct mac_ifinfo **mac_ptr) |
| Function returns information about all existing interfaces.
|
void | mac_free_ifinfo (struct mac_ifinfo **mac_ptr) |
| Memory allocated by the function mac_get_ifinfo(), to store information on existing interfaces, is set free by this function.
|
int | iw_sockets_open (void) |
| Function that opens a socket and returns the descriptor on success.
|
char * | pr_ether (unsigned char *ptr) |
| Function that returns a string containing the MAC address seperated by colons.
|
int | mac_send_broadcast (u_char *payload, short len, struct mac_ifinfo_list *q) |
| Function sends an 802.11 frame to the broadcast MAC address.
|
int | mac_send_unicast (u_char *payload, short len, struct mac_ifinfo_list *q, unsigned char *ucast_mac) |
| Function sends an 802.11 frame to a unicast MAC address.
|
int | mac_recv (struct ether_header **header, char **payload, unsigned short *len, unsigned char **send_params, unsigned char **recv_params, struct mac_ifinfo_list *q, char *filter) |
| Function receives the ethernet frame, encapsulated within an 802.11 frame, on an interface specified by the user and retrieves pointers to the header, payload and parameters.
|
int | mac_promisc_recv (unsigned char **frame, unsigned short *frame_len, unsigned char **send_params, unsigned char **recv_params, struct mac_ifinfo_list *q) |
| Function receives the 802.11 frame, on an interface specified by the user and retrieves pointers to the frame, length and parameters.
|
int | mac_init_params (struct mac_params **h, struct mac_params_flags **g) |
| Function allocates memory and initializes the mac_params and mac_params_flags structures.
|
void | mac_free_params (struct mac_params **h, struct mac_params_flags **g) |
| Memory allocated by the function mac_init_params(), is set free by this function.
|
int | mac_get_params (struct mac_params *h, struct mac_ifinfo_list *if_ptr, int argc,...) |
| Function that requests the driver to return parameter information, specified by the fourth argument onwards.
|
int | mac_set_params (struct mac_params *h, struct mac_ifinfo_list *if_ptr, int argc,...) |
| Function that requests the driver to operate on particular parameter settings, specified by the fourth argument onwards.
|
int | mac_append_params (struct mac_ifinfo_list *if_ptr, unsigned char direction, int argc,...) |
| Function that requests the driver to append parameter information, specified by the fourth argument onwards.
|