home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp / src / devs / netinfo / entries.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-19  |  2.1 KB  |  103 lines

  1. #ifndef _ENTRIES_H_
  2. #define _ENTRIES_H_ "$Id: entries.h,v 3.2 1994/05/19 04:29:29 ppessi Exp $"
  3. /* 
  4.  * entries.h --- db units
  5.  *
  6.  * Author: ppessi <Pekka.Pessi@hut.fi>
  7.  *
  8.  * Copyright © 1993 AmiTCP/IP Group, <AmiTCP-group@hut.fi>
  9.  *                  Helsinki University of Technology, Finland.
  10.  *
  11.  * Created      : Sat Jan 15 07:20:35 1994 ppessi
  12.  * Last modified: Thu May 19 04:05:41 1994 ppessi
  13.  *
  14.  */
  15.  
  16. #include "base.h"
  17.  
  18. struct NetInfoEnt {
  19.   UBYTE *nie_name;
  20.   ULONG  nie_fill;
  21.   ULONG  nie_id;
  22. };
  23.  
  24. /*
  25.  * Common values are represented with this structure
  26.  */
  27. struct Ent {
  28.   struct Node e_node;
  29.   UWORD       e_tlen;        /* size of text data */
  30.   UBYTE      *e_name;
  31.   LONG        e_pwd;
  32.   LONG        e_id;
  33. };
  34.  
  35. struct PasswdEnt {
  36.   struct Node          pe_node;
  37.   UWORD                pe_tlen;
  38.   struct NetInfoPasswd pe_passwd[1];
  39. };
  40.  
  41. /* we may have an extended version of passwd */
  42. #define PASSWDFIELDS 7
  43.  
  44. struct GroupEnt {
  45.   struct Node         ge_node;
  46.   UWORD               ge_tlen;
  47.   struct NetInfoGroup ge_group[1];
  48.   ULONG               ge_nmembers;    /* actually, # of members + 1 */
  49. };
  50.  
  51. /*
  52.  * Entry Node Type
  53.  */
  54. #define ENT_PASSWD 30
  55. #define ENT_GROUP  31
  56.  
  57. /*
  58.  * The changed entries are marked
  59.  */
  60. #define ENT_CHANGED 1
  61.  
  62. /*
  63.  * Maximum entry length
  64.  */
  65. #define MAXLINELENGTH 1024
  66.  
  67. /*
  68.  * Database paths
  69.  */
  70. #define _PATH_PASSWD  "AmiTCP:db/passwd"
  71. #define _PATH_GROUP   "AmiTCP:db/group"
  72.  
  73. /* 
  74.  * As this far there are no quick commands
  75.  * we bother to lock only niu_ReqLock
  76.  */
  77. #define DbMapLock(u) 
  78. #define DbMapLockShared(u) 
  79. #define DbMapUnlock(u) 
  80.  
  81. /* common methods in entries.c */ 
  82. void EntCleanup(BASE, struct NetInfoMap *nim);
  83. void EntHandleNotify(BASE, struct NetInfoMap *nim);
  84.  
  85. typedef struct NetInfoMap *(*init_map_func_t)(BASE);
  86. struct NetInfoMap *InitPasswdMap(BASE);
  87. struct NetInfoMap *InitGroupMap(BASE);
  88.  
  89. /* Other prototypes */
  90. struct Ent *InternalSetEnts(BASE, struct NetInfoMap *nim);
  91. void InternalEndEnts(BASE, struct NetInfoMap *nim);
  92. struct Ent *GetNextEnt(struct Ent *e);
  93.  
  94. /* Utility */
  95. static __inline char *stpcopy(char *to, const char *from)
  96. {
  97.   while (*to++ = *from++)
  98.     ;
  99.   return to;
  100. }
  101.  
  102. #endif /* _ENTRIES_H_ */
  103.