Cross reference for modules/ip/iproutines.h of index.

# File modules/ip/iproutines.h

      $Revision: 1.16 $

      IP handling (ip). iproutines.h  - header file for conversions routines.
                                        defines data structures for IP module.

      Status: NOT REVUED, TESTED

      Design and implementation by: Marek Bukowy

## Included Files

- `#include <glib.h>`

- `#include <include/erroutines.h>`

- `#include <sys/types.h>`

## Preprocessor definitions

`#define _IP_H`

`#define IPLIMBNUM`

the length of a string that should be able to hold a prefix / range when used with b2a functions.

`#define IP_ADDRSTR_MAX 20`

`#define IP_PREFSTR_MAX 24`

`#define IP_RANGSTR_MAX 48`

the e2b macros assume fully expanded text

`#define IP_addr_e2b( a, b )`

`#define IP_pref_e2b( a, b )`

`#define IP_rang_e2b( a, b )`

`#define IP_revd_e2b( a, b )`

the a2b macros will fully expand an address. The details depend on the individual functions.

`#define IP_addr_a2b( a, b )`

`#define IP_pref_a2b( a, b )`

`#define IP_rang_a2b( a, b )`

`#define IP_revd_a2b( a, b )`

`#define IP_pref_b2v4_len( prefix )`

`#define IP_pref_b2v6_len( prefix )`

`#define IP_revd_b2v4( a, b, c )`

`#define IP_revd_b2v6( a, b, c, d )`

## Typedef ip_keytype_t

the key type (for ascii keys - tells what it was before it was converted into prefixes in smart_conv()

`typedef enum {...} ip_keytype_t`

`enum` |
`{` |
`IPK_UNDEF;` |
`IPK_RANGE;` |
`IPK_PREFIX;` |
`IPK_IP;` |
`}` |

## Typedef ip_space_t

the space type

`typedef enum {...} ip_space_t`

`enum` |
`{` |
`IP_V4;` |
`IP_V6;` |
`}` |

## Typedef ip_limb_t

`typedef unsigned int ip_limb_t`

## Typedef ip_v6word_t

`typedef uint64_t ip_v6word_t`

## Typedef ip_addr_internal_t

address structure

`typedef struct {...} ip_addr_internal_t`

`struct` |
`{` |
`ip_limb_t words[(16/sizeof(ip_limb_t))];` | 32/128 bit ip addr. SUBJECT TO CHANGE
`ip_space_t space;` | MUST NOT BE char ! prefixes are compared with memcmp, so there may be absolutely no unitialised bytes
`}` |

## Typedef ip_prefix_internal_t

prefix structure

`typedef struct {...} ip_prefix_internal_t`

`struct` |
`{` |
`unsigned bits;` | length in bits.
`ip_addr_internal_t ip;` | the IP of the prefix
`}` |

## Typedef ip_range_internal_t

range structure

`typedef struct {...} ip_range_internal_t`

`struct` |
`{` |
`ip_addr_internal_t begin;` | IP where the range begins.
`ip_addr_internal_t end;` | IP where it ends
`}` |

## Typedef ip_addr_t

`typedef ip_addr_internal_t ip_addr_t`

See:
  - Typedef ip_addr_internal_t

## Typedef ip_range_t

`typedef ip_range_internal_t ip_range_t`

See:
  - Typedef ip_range_internal_t

## Typedef ip_prefix_t

`typedef ip_prefix_internal_t ip_prefix_t`

See:
  - Typedef ip_prefix_internal_t

## Typedef ip_rangesize_t

stores size/span of an allocation SUBJECT TO CHANGE: will be bigger for IPv6

`typedef unsigned int ip_rangesize_t`

## Typedef ip_exp_t

IP expansion mode - for use with t2b functions, they control whether the input is supposed to be fully expanded or contain shortcuts (eg. enabling saying 0/0 instead 0.0.0.0/0)

`typedef enum {...} ip_exp_t`

`enum` |
`{` |
`IP_PLAIN;` |
`IP_EXPN;` |
`}` |

## External Variables

IP_ADDR_UNSPEC
`extern ip_addr_t IP_ADDR_UNSPEC`

Defined in: | modules/ip/ip.c