Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

modem.h File Reference

#include "config.h"
#include "packets.h"

Go to the source code of this file.

Defines

#define HITACHI_MARK1   "0003C9"
 This string of characters identifies an HITACHI hardware address (in hexa).

#define HITACHI_MARK2   "001638"
 This string of characters identifies an HITACHI hardware address (in hexa).

#define SAGEM_MARK1   "00604C"
 This string of characters identifies an SAGEM hardware address (in hexa).

#define SAGEM_MARK2   "001556"
 This string of characters identifies an SAGEM hardware address (in hexa).

#define MODEM_HITACHI   1
 Return value for the function get_modem_manufacturor(). This value identifies an HITACHI modem.

#define MODEM_SAGEM   2
 Return value for the function get_modem_manufacturor(). This value identifies an SAGEM modem.

#define MODEM_UNKNOWN   0
 Return value for the function get_modem_manufacturor(). This value is returned if the function does not find the modem's manufacturor.


Functions

void init_modem_syslog (int(*syslog)(const char *file, const char *fmt,...), char *log, int debug)
 Initialize the syslog service. More...

int get_modem_manufacturor (struct dhcp_packet *packet)
 Find the manufacturor of a modem (looking at the DHCP packet). More...

char * calculate_modem_mac_address (struct dhcp_packet *packet, int manufacturor)
 Calculate the modem's network MAC address from the modem mother board MAC address. More...

char * id_manufacturor_to_string (int id)
 Return a string that represents the modem's manufacturor. More...


Detailed Description

Header file for the file 'modem.c'.

Definition in file modem.h.


Function Documentation

char* calculate_modem_mac_address struct dhcp_packet   packet,
int    manufacturor
 

Calculate the modem's network MAC address from the modem mother board MAC address.

Author:
Denis BEURIVE
Parameters:
packet  Pointer to a 'dhcp_packet' data structure that represents the incoming packet.
manufacturor  Integer value that represents the modem's manufacturor (as returnrd by the function get_modem_manufacturor()).
Returns:
The function returns a pointer to a statically allocated string of characters that represents the mac address in hexadecimal notation (without ':').

Definition at line 105 of file modem.c.

int get_modem_manufacturor struct dhcp_packet   packet
 

Find the manufacturor of a modem (looking at the DHCP packet).

Author:
Denis BEURIVE
Parameters:
packet  Pointer to a 'dhcp_packet' data structure that represents the incoming packet. associated with the interace.
Returns:
The function returns an integer value that represents the modem's manufacturor. The list of possible values is defined in the file 'modem.h'.
Remarks:
The returned value MODEM_UNKNOWN means that the modem is not in the list of selected modems. This is not an error.

Definition at line 71 of file modem.c.

char* id_manufacturor_to_string int    id
 

Return a string that represents the modem's manufacturor.

Author:
Denis BEURIVE
Parameters:
id  Integer that represents the manufacturor (see file 'modem.h' for the list of IDs).
Returns:
The function returns a pointer to a zero terminated string of characters that represents the modem's manufacturor.

Definition at line 176 of file modem.c.

void init_modem_syslog int(*    syslog)(const char *file, const char *fmt,...),
char *    log,
int    debug
 

Initialize the syslog service.

Author:
Denis BEURIVE
Parameters:
syslog  Pointer to a function used to log messages. The function signature must be :

int syslog (const char *file, const char * fmt,...)

Upon successful completion, the function returns the value 0.

To desactivate logging, just set this pointer to NULL.

If NULL, logging service is not activated (no matter the value of 'log').

Parameters:
log  Pointer to the log file. If NULL, logging service is not activated (no matter the value of 'syslog').
debug  Integer that set the debug level (0: no debug).

Definition at line 46 of file modem.c.


Generated on Mon Jun 19 12:31:06 2006 for MyDhcp_V2 by doxygen1.2.15