420 remove patch (sparse package) support from svr4 pkg
[illumos-gate.git] / usr / src / cmd / agents / snmp / snmplib / impl.h
blob5b5904915909ea8387125e0f060fc6ba1e031269
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright (c) 1998, 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _IMPL_H
28 #define _IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #include <sys/types.h>
38 /* Exported Constants */
40 #ifndef NULL
41 #define NULL 0
42 #endif
44 #ifndef TRUE
45 #define TRUE 1
46 #endif
47 #ifndef FALSE
48 #define FALSE 0
49 #endif
51 #ifndef True
52 #define True 1
53 #endif
54 #ifndef False
55 #define False 0
56 #endif
58 #ifndef MIN
59 #define MIN(x, y) ((x) < (y)? (x) : (y))
60 #endif
61 #ifndef MAX
62 #define MAX(x, y) ((x) > (y)? (x) : (y))
63 #endif
65 #define NOT_IMPLEMENTED -1
66 #define END_OF_TABLE -2
67 #define OTHER_ERROR -3
69 #define EXACT_ENTRY 1
70 #define FIRST_ENTRY 2
71 #define NEXT_ENTRY 3
73 #define FIRST_PASS 1
74 #define SECOND_PASS 2
77 /* Exported Types */
79 typedef int32_t Integer;
82 typedef struct _String {
83 uchar_t *chars;
84 int len;
85 } String;
88 typedef uint32_t Subid;
90 typedef struct _Oid {
91 Subid *subids;
92 int len;
93 } Oid;
95 typedef struct _IndexType {
96 int type;
97 int len;
98 int *value;
99 } IndexType;
101 typedef struct in_addr IPAddress;
102 typedef struct sockaddr_in Address;
105 /* Exported Functions */
107 extern char *pdu_type_string(uchar_t type);
108 extern char *asn1_type_string(uchar_t type);
109 extern char *error_status_string(int status);
110 extern char *generic_trap_string(int generic);
111 extern char *SSAOidString(Oid *oid);
112 extern char *timeval_string(struct timeval *tv);
113 extern char *ip_address_string(IPAddress *ip_address);
114 extern char *address_string(Address *address);
116 /* Conversion Routines */
117 extern char *SSAStringToChar(String str);
118 extern Oid *SSAOidStrToOid(char *name, char *error_label);
120 extern void SSAStringZero(String *string);
121 extern int SSAStringInit(String *string, uchar_t *chars, int len,
122 char *error_label);
123 extern int SSAStringCpy(String *string1, String *string2, char *error_label);
125 extern Oid *SSAOidNew(void);
126 extern void SSAOidZero(Oid *oid);
127 extern void SSAOidFree(Oid *oid);
128 extern int SSAOidInit(Oid *oid, Subid *subids, int len, char *error_label);
129 extern int SSAOidCpy(Oid *oid1, Oid *oid2, char *error_label);
130 extern Oid *SSAOidDup(Oid *oid, char *error_label);
131 extern int SSAOidCmp(Oid *oid1, Oid *oid2);
133 extern int name_to_ip_address(char *name, IPAddress *ip_address,
134 char *error_label);
135 extern int get_my_ip_address(IPAddress *my_ip_address, char *error_label);
137 #ifdef __cplusplus
139 #endif
141 #endif /* _IMPL_H */