Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

hitachi.c File Reference

#include <string.h>

Go to the source code of this file.

Functions

char minus4 (char car, int *carry)
 Subtract 4 from a given digit. More...

char minus1 (char car, int *carry)
 Subtract 1 from a given digit. More...

char * calculate_mac (char *haddr)
 Subtract 4 from a given number writen in hexadecimal. More...


Detailed Description

This file implements special Hitachi's MAC address processing.

Definition in file hitachi.c.


Function Documentation

char* calculate_mac char *    haddr
 

Subtract 4 from a given number writen in hexadecimal.

Author:
Denis BEURIVE
Parameters:
haddr  Pointer to a zero terminated string of characters that represents the number writen in hexadecimal base.
Returns:
The function returns a pointer to "haddr". The string "haddr" now represents the value "haddr-4".
Warning:
This function modifies the content of the string pointed by "haddr"). If macro "USE_PLUGINS" is defined, then the function returns a pointer to a statically allocated buffer. Otherwize, the function returns "haddr" itself.
Remarks:
This function should be used to calculate the MAC address of an HITACHI modem.

Definition at line 97 of file hitachi.c.

References minus1(), and minus4().

char minus1 char    car,
int *    carry
[static]
 

Subtract 1 from a given digit.

Author:
Denis BEURIVE
Parameters:
car  Hexadecimal character that represents the digit.
carry  Pointer to an integer that will be used to signal a possible crry. The value pointed by "carry" can be:
  • 0: no carry.
  • 1: carry.
Returns:
The function returns the value "car-1" in hexadecimal.

Definition at line 60 of file hitachi.c.

Referenced by calculate_mac().

char minus4 char    car,
int *    carry
[static]
 

Subtract 4 from a given digit.

Author:
Denis BEURIVE
Parameters:
car  Hexadecimal character that represents the digit.
carry  Pointer to an integer that will be used to signal a possible crry. The value pointed by "carry" can be:
  • 0: no carry.
  • 1: carry.
Returns:
The function returns the value "car-4" in hexadecimal.

Definition at line 22 of file hitachi.c.

Referenced by calculate_mac().


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