1 #ifndef DEVICES_NETINFO_H
    2 #define DEVICES_NETINFO_H
    3 
    4 /*
    5 	netinfo.device include
    6 
    7 	Copyright © 2003 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 #include <exec/types.h>
   12 #endif
   13 #ifndef EXEC_IO_H
   14 #include <exec/io.h>
   15 #endif
   16 
   17 #pragma pack(2)
   18 
   19 #define NETINFONAME "netinfo.device"
   20 
   21 /*
   22  * Modified IOStdReq
   23  */
   24 struct NetInfoReq
   25 {
   26 	struct  Message  io_Message;
   27 	struct  Device  *io_Device; /* device node pointer  */
   28 	struct  Unit    *io_Unit;   /* unit (driver private) */
   29 	UWORD   io_Command;         /* device command */
   30 	UBYTE   io_Flags;
   31 	BYTE    io_Error;           /* error or warning num */
   32 	ULONG   io_Actual;          /* actual number of bytes transferred */
   33 	ULONG   io_Length;          /* requested number bytes transferred*/
   34 	APTR    io_Data;            /* points to data area */
   35 	ULONG   io_Offset;          /* search criteria */
   36 };
   37 
   38 #define NETINFOLENGTH_SAVEMODE          -1      /* Only used with CMD_UPDATE and io_Length to decide the store policy */
   39 /*
   40  * NetInfo units
   41  */
   42 #define NETINFO_PASSWD_UNIT    0L
   43 #define NETINFO_GROUP_UNIT     1L
   44 #define NETINFO_HOST_UNIT      2L
   45 #define NETINFO_PROTOCOL_UNIT  3L
   46 #define NETINFO_SERVICE_UNIT   4L
   47 #define NETINFO_INETD_UNIT     5L
   48 #define NETINFO_UNITS          6L
   49 
   50 /* 
   51  * Non-standard commands
   52  */
   53 #define NI_GETBYID    (CMD_NONSTD+0)
   54 #define NI_GETBYNAME  (CMD_NONSTD+1)
   55 #define NI_MEMBERS    (CMD_NONSTD+2)
   56 #define NI_END        (CMD_NONSTD+3)
   57 
   58 /*
   59  * Non-standard error codes (same as in the BSD errno)
   60  */
   61 #define NIERR_NOTFOUND      2
   62 #define NIERR_TOOSMALL      7
   63 #define NIERR_NOMEM         12
   64 #define NIERR_ACCESS        13
   65 #define NIERR_NULL_POINTER  14
   66 #define NIERR_INVAL         22
   67 
   68 /* The passwd structure */
   69 struct NetInfoPasswd
   70 {
   71 	UBYTE *pw_name;               /* Username */
   72 	UBYTE *pw_passwd;             /* Encrypted password */
   73 	LONG   pw_uid;                /* User ID */
   74 	LONG   pw_gid;                /* Group ID */
   75 	UBYTE *pw_gecos;              /* Real name etc */
   76 	UBYTE *pw_dir;                /* Home directory */
   77 	UBYTE *pw_shell;              /* Shell */
   78 };
   79 
   80 /* The group structure */
   81 struct NetInfoGroup
   82 {
   83 	UBYTE  *gr_name;              /* Group name.  */
   84 	UBYTE  *gr_passwd;            /* Password.    */
   85 	LONG    gr_gid;               /* Group ID.    */
   86 	UBYTE **gr_mem;               /* Member list. */
   87 };
   88 
   89 /* The host structure */
   90 struct NetInfoHost
   91 {
   92 	UBYTE  *ho_domain;         /* Host Domain */
   93 	UBYTE  *ho_address;        /* Host IP Address */
   94 	UBYTE **ho_aliases;        /* Alias list. */
   95 };
   96 
   97 /* The protocol structure */
   98 struct NetInfoProtocol
   99 {
  100 	UBYTE  *po_name;           /* Protocol name */
  101 	ULONG	po_id;
  102 };
  103 
  104 /* The service structure */
  105 struct NetInfoService
  106 {
  107 	UBYTE  *se_name;           /* Service Name */
  108 	ULONG  se_port;            /* Service Port */
  109 	UBYTE  *se_protocol;       /* Service Protocol */
  110 	UBYTE  *se_comment;        /* Service Protocol */
  111 	UBYTE **se_aliases;        /* Service Alias list. */
  112 };
  113 
  114 /* The inetd.conf structure */
  115 struct NetInfoINetD
  116 {
  117 	UBYTE  *in_name;
  118 	UBYTE  *in_socket;
  119 	UBYTE  *in_protocol;
  120 	UBYTE  *in_waitstate;
  121 	UBYTE  *in_user;
  122 	UBYTE  *in_server;
  123 	UBYTE  *in_serverargs;
  124 	ULONG  in_disabled;
  125 };
  126 
  127 
  128 #pragma pack()
  129 
  130 #endif /* !DEVICES_NETINFO_H */
  131