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
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]
23 * Copyright (c) 1998, 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/types.h>
38 /* Exported Constants */
59 #define MIN(x, y) ((x) < (y)? (x) : (y))
62 #define MAX(x, y) ((x) > (y)? (x) : (y))
65 #define NOT_IMPLEMENTED -1
66 #define END_OF_TABLE -2
67 #define OTHER_ERROR -3
79 typedef int32_t Integer
;
82 typedef struct _String
{
88 typedef uint32_t Subid
;
95 typedef struct _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
,
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
,
135 extern int get_my_ip_address(IPAddress
*my_ip_address
, char *error_label
);