#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include "netdevice.h"
#include "message.h"
#include "iwconnect.h"
#include "iwc_print.h"
Go to the source code of this file.
Functions | |
int | iwc_init_host () |
int | iwc_init_model (const char *) |
int | iwc_init_net () |
int | iwc_init_check_pidfile (const char *) |
int | iwc_init_create_pidfile (const char *) |
int | iwc_init_remove_pidfile (const char *) |
int | iwc_model_register () |
int | iwc_model_deregister () |
void | iwc_model_update (int, const char *) |
void | iwc_notify_poll (void *) |
void | iwc_usage () |
void | iwc_help () |
int | ignore_debug (const char *text,...) |
int | print_debug (const char *format,...) |
void | ignore_debug_args (const char *format, va_list arg) |
void | print_debug_args (const char *format, va_list arg) |
int | iwc_error (const char *format,...) |
void | iwc_log (const char *format,...) |
void | iwc_shutdown (int signal) |
void | iwc_daemon () |
int | iwc_pars_opts (int argc, char *argv[]) |
int | main (int argc, char *argv[]) |
Variables | |
char * | exec_name = NULL |
const char | iwc_version [] = "0.3.0beta\0" |
const char | iwc_pidfile [] = "/var/run/iwconnect.pid" |
iwc_client_info | client_info |
iwc_model_info | model_info |
int | num_vif |
int | tap_sockets [MAX_NUM_VIF] |
int | net_socket |
int | direct |
int | iwc_dbg |
int | is_registered |
int | ip_family |
Usage: iwconnect MODELIP:MODELPORT LOCALPORT [-i INTERFACE][-6][-n][-d]
Tunnels traffic from a virtual wireless interface to a wireless emulation model. First you have to create a virtual interface with `vifctl -c INTERFACE`. The virtual interfaces are then detected rm automatically.
Parameters:
MODELIP:PORT IP Address/Hostname and port number of wireless model LOCALPORT Local port to listen for model replies -6 Use IPv6 protocol -d Enable debug output -h Show this help message -i INTERFACE Tunnel interface (default: eth0) -n Enable node-to-node communication (only for testing!)
Definition in file iwconnect.c.
int ignore_debug | ( | const char * | text, | |
... | ||||
) |
Stub for print_debug signature
Definition at line 136 of file iwconnect.c.
void ignore_debug_args | ( | const char * | format, | |
va_list | arg | |||
) |
Stub for print_debug_args signature
Definition at line 156 of file iwconnect.c.
void iwc_daemon | ( | ) |
Listen to TUN and network interfaces for "wireless" packets
Definition at line 252 of file iwconnect.c.
int iwc_error | ( | const char * | format, | |
... | ||||
) |
Print error message
Definition at line 172 of file iwconnect.c.
void iwc_help | ( | ) |
Print help
Definition at line 114 of file iwconnect.c.
int iwc_init_check_pidfile | ( | const char * | path | ) |
Check for valid PID file
Definition at line 451 of file iwc_init.c.
int iwc_init_create_pidfile | ( | const char * | path | ) |
Create a PID file
Definition at line 407 of file iwc_init.c.
int iwc_init_host | ( | ) |
Initialize client host variables
Definition at line 249 of file iwc_init.c.
int iwc_init_model | ( | const char * | arg | ) |
Check "IP/hostname:port" pair for validity and fills iwc_model_info
arg | Command line arguments |
Definition at line 160 of file iwc_init.c.
int iwc_init_net | ( | ) |
Initialize network sockets
Definition at line 350 of file iwc_init.c.
int iwc_init_remove_pidfile | ( | const char * | path | ) |
Remove the PID file
Definition at line 435 of file iwc_init.c.
void iwc_log | ( | const char * | format, | |
... | ||||
) |
Send message to syslog and print to stdout
Definition at line 191 of file iwconnect.c.
int iwc_model_deregister | ( | void | ) |
Deregisters node from WlanModel
Definition at line 212 of file iwc_model.c.
int iwc_model_register | ( | void | ) |
Register the host at the WlanModel
Definition at line 89 of file iwc_model.c.
void iwc_model_update | ( | int | ioctl_type, | |
const char * | dev_name | |||
) |
Sends config_msg to update wireless parameter at WlanModel
ioctl_type | Ioctl type | |
dev_name | Virtual wireless device name |
Definition at line 254 of file iwc_model.c.
void iwc_notify_poll | ( | void * | msg_handler | ) |
Poll the notification queue for arriving messages. On message reception run the given msg_handler function with the message content
msg_handler | Pointer to a client function handling parameter changes. Its signature is void func(int ioctl_type, char *dev_name) |
Definition at line 82 of file iwc_notify.c.
int iwc_pars_opts | ( | int | argc, | |
char * | argv[] | |||
) |
Parse command line options and checks it for validity
Definition at line 374 of file iwconnect.c.
void iwc_shutdown | ( | int | signal | ) |
Shutdown iwconnect and deregister at WlanModel
Definition at line 214 of file iwconnect.c.
void iwc_usage | ( | ) |
Print usage details
Definition at line 103 of file iwconnect.c.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
MAIN
Definition at line 479 of file iwconnect.c.
int print_debug | ( | const char * | format, | |
... | ||||
) |
Print debug message with variable argument list
Definition at line 143 of file iwconnect.c.
void print_debug_args | ( | const char * | format, | |
va_list | arg | |||
) |
Print debug message with given argument list
Definition at line 162 of file iwconnect.c.
Wireless client information
Definition at line 76 of file iwconnect.c.
int direct |
Indicate direct node to node mode
Definition at line 87 of file iwconnect.c.
char* exec_name = NULL |
Program name
Definition at line 71 of file iwconnect.c.
int ip_family |
IP protocol version to use (AF_INET for IPv4, AF_INET6 for IPv6)
Definition at line 96 of file iwconnect.c.
int is_registered |
Are we registered at the WlanModel
Definition at line 93 of file iwconnect.c.
int iwc_dbg |
Indicate debug level (0|1)
Definition at line 90 of file iwconnect.c.
const char iwc_pidfile[] = "/var/run/iwconnect.pid" |
PID file
Definition at line 73 of file iwconnect.c.
const char iwc_version[] = "0.3.0beta\0" |
Program version
Definition at line 72 of file iwconnect.c.
Wireless model information
Definition at line 77 of file iwconnect.c.
int net_socket |
Network socket file descriptor
Definition at line 84 of file iwconnect.c.
int num_vif |
Number of virtual interfaces
Definition at line 80 of file iwconnect.c.
int tap_sockets[MAX_NUM_VIF] |
TAP socket file descriptors
Definition at line 83 of file iwconnect.c.