Back to index

glibc  2.9
Classes | Defines | Functions
files-ethers.c File Reference
#include <string.h>
#include <netinet/ether.h>
#include <netinet/if_ether.h>
#include "files-parse.c"

Go to the source code of this file.

Classes

struct  etherent_data

Defines

#define ENTNAME   etherent
#define DATABASE   "ethers"

Functions

 LINE_PARSER ("#")

Class Documentation

struct etherent_data

Definition at line 23 of file files-ethers.c.


Define Documentation

#define DATABASE   "ethers"

Definition at line 26 of file files-ethers.c.

#define ENTNAME   etherent

Definition at line 25 of file files-ethers.c.


Function Documentation

LINE_PARSER ( "#"  )

Definition at line 29 of file files-ethers.c.

 {
   size_t cnt;

   for (cnt = 0; cnt < 6; ++cnt)
     {
       unsigned int number;

       if (cnt < 5)
        INT_FIELD (number, ISCOLON , 0, 16, (unsigned int))
       else
        INT_FIELD (number, isspace, 1, 16, (unsigned int))

       if (number > 0xff)
        return 0;
       result->e_addr.ether_addr_octet[cnt] = number;
     }
 };
 STRING_FIELD (result->e_name, isspace, 1);
 )


#include GENERIC

DB_LOOKUP (hostton, 1 + strlen (name), (".%s", name),
          {
            if (__strcasecmp (result->e_name, name) == 0)
              break;
          }, const char *name)