home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / sys / sysctl.h < prev    next >
C/C++ Source or Header  |  1999-05-11  |  6KB  |  153 lines

  1. /*
  2.  * Copyright (c) 1989, 1993
  3.  *      The Regents of the University of California.  All rights reserved.
  4.  *
  5.  * This code is derived from software contributed to Berkeley by
  6.  * Mike Karels at Berkeley Software Design, Inc.
  7.  *
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Redistributions in binary form must reproduce the above copyright
  14.  *    notice, this list of conditions and the following disclaimer in the
  15.  *    documentation and/or other materials provided with the distribution.
  16.  * 3. All advertising materials mentioning features or use of this software
  17.  *    must display the following acknowledgement:
  18.  *      This product includes software developed by the University of
  19.  *      California, Berkeley and its contributors.
  20.  * 4. Neither the name of the University nor the names of its contributors
  21.  *    may be used to endorse or promote products derived from this software
  22.  *    without specific prior written permission.
  23.  *
  24.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  25.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  28.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  30.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  32.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  33.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  34.  * SUCH DAMAGE.
  35.  *
  36.  *      @(#)sysctl.h    8.2 (Berkeley) 3/30/95
  37.  */
  38.  
  39. #ifndef _SYS_SYSCTL_H_
  40. #define _SYS_SYSCTL_H_
  41.  
  42. #ifdef TCPV40HDRS
  43. #error error: sys\sysctl.h is for TCP/IP toolkit 5.0 or later releases only
  44. #else
  45. /*
  46.  * Definitions for sysctl call.  The sysctl call uses a hierarchical name
  47.  * for objects that can be examined or modified.  The name is expressed as
  48.  * a sequence of integers.  Like a file path name, the meaning of each
  49.  * component depends on its place in the hierarchy.  The top-level and kern
  50.  * identifiers are defined here, and other identifiers are defined in the
  51.  * respective subsystem header files.
  52.  */
  53.  
  54. #define CTL_MAXNAME     12      /* largest number of components supported */
  55.  
  56. /*
  57.  * Each subsystem defined by sysctl defines a list of variables
  58.  * for that subsystem. Each name is either a node with further
  59.  * levels defined below it, or it is a leaf of some particular
  60.  * type given below. Each sysctl level defines a set of name/type
  61.  * pairs to be used by sysctl(1) in manipulating the subsystem.
  62.  */
  63. struct ctlname {
  64.         char    *ctl_name;      /* subsystem name */
  65.         int     ctl_type;       /* type of name */
  66. };
  67.  
  68. #define CTLTYPE_NODE    1       /* name is a node */
  69. #define CTLTYPE_INT     2       /* name describes an integer */
  70. #define CTLTYPE_STRING  3       /* name describes a string */
  71. #define CTLTYPE_QUAD    4       /* name describes a 64-bit number */
  72. #define CTLTYPE_STRUCT  5       /* name describes a structure */
  73. #define CTLTYPE_INETCFG 6       /* inetcfg sysctl code */
  74. #define CTLTYPE_INEVER  7       /* inetver sysctl code */
  75.  
  76. /*
  77.  * Top-level identifiers
  78.  */
  79. #define CTL_KERN        1               /* "high kernel": proc, limits */
  80. #define CTL_NET         4               /* network, see socket.h */
  81. #define CTL_OS2         9               /* OS/2 specific codes */
  82.  
  83. #define CTL_NAMES { \
  84.         { 0, 0 }, \
  85.         { "kern", CTLTYPE_NODE }, \
  86.         { "net", CTLTYPE_NODE }, \
  87.         { "os2", CTLTYPE_NODE }, \
  88. }
  89.  
  90. /*
  91.  * CTL_KERN identifiers
  92.  */
  93. #define KERN_MAXFILES            7      /* int: max open files */
  94. #define KERN_HOSTNAME           10      /* string: hostname */
  95. #define KERN_HOSTID             11      /* int: host identifier */
  96.  
  97. #define CTL_KERN_NAMES { \
  98.         { 0, 0 }, \
  99.         { "ostype", CTLTYPE_STRING }, \
  100.         { "osrelease", CTLTYPE_STRING }, \
  101.         { "osrevision", CTLTYPE_INT }, \
  102.         { "version", CTLTYPE_STRING }, \
  103.         { "maxvnodes", CTLTYPE_INT }, \
  104.         { "maxproc", CTLTYPE_INT }, \
  105.         { "maxfiles", CTLTYPE_INT }, \
  106.         { "argmax", CTLTYPE_INT }, \
  107.         { "securelevel", CTLTYPE_INT }, \
  108.         { "hostname", CTLTYPE_STRING }, \
  109.         { "hostid", CTLTYPE_INT }, \
  110.         { "clockrate", CTLTYPE_STRUCT }, \
  111.         { "vnode", CTLTYPE_STRUCT }, \
  112.         { "proc", CTLTYPE_STRUCT }, \
  113.         { "file", CTLTYPE_STRUCT }, \
  114.         { "profiling", CTLTYPE_NODE }, \
  115.         { "posix1version", CTLTYPE_INT }, \
  116.         { "ngroups", CTLTYPE_INT }, \
  117.         { "job_control", CTLTYPE_INT }, \
  118.         { "saved_ids", CTLTYPE_INT }, \
  119.         { "boottime", CTLTYPE_STRUCT }, \
  120. }
  121.  
  122. /*
  123.  * KERN_SYSCTL objects
  124.  */
  125. #define KERNCTL_INETVER      70          /* Sysctl code for sockets Inetversion */
  126. #define OS2_MEMMAPIO         1           /* memory map io */
  127. #define OS2_QUERY_MEMMAPIO   2           /* Query if mapped memory usable */
  128.  
  129. /* Generic Structure for Inetcfg calls */
  130. struct inetcfg_ctl{
  131.           unsigned long var_name;
  132.           unsigned long var_cur_val;
  133.           unsigned long var_max_val;
  134.           unsigned long var_def_val;
  135.           unsigned long var_min_val;
  136. };
  137.  
  138. /* Inetversion */
  139. struct inetvers_ctl {
  140.          float version;
  141.          char  versionstr[10];           /* Less than 10 chars in version string */
  142. };
  143.  
  144. #include <sys/cdefs.h>
  145. #ifndef KERNEL
  146. __BEGIN_DECLS
  147. int _System sysctl __TCPPROTO((int *, u_int, void *, size_t *, void *, size_t));
  148. __END_DECLS
  149. #endif
  150.  
  151. #endif /* TCPV40HDRS */
  152. #endif /* !_SYS_SYSCTL_H_ */
  153.