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]
22 * Copyright 1996 Sun Microsystems, Inc. All Rights Reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
30 #include <sys/types.h>
31 #include <sys/socket.h>
32 #include <netinet/in.h>
33 #include <arpa/inet.h>
44 /***** STATIC VARIABLES *****/
47 Agent
*first_agent
= NULL
;
50 /***** STATIC FUNCTIONS *****/
52 static void agent_free(Agent
*ap
);
55 /****************************************************************/
63 for(ap
= first_agent
; ap
; ap
= ap
->next_agent
)
65 trace("\t%-30s %-30s %8d\n",
67 address_string(&(ap
->address
)),
74 /****************************************************************/
76 /* We must invoke subtree_list_delete() before invoking */
77 /* this function because the first_agent_subtree member */
78 /* of the agent structures should be NULL */
80 void agent_list_delete()
82 Agent
*ap
= first_agent
;
88 next
= ap
->next_agent
;
101 /****************************************************************/
103 /* The fisrt_agent_subtree member of the agent */
104 /* structure should be NULL */
106 static void agent_free(Agent
*ap
)
113 if(ap
->first_agent_subtree
)
115 error("BUG: agent_free(): first_agent_subtree not NULL");
124 /****************************************************************/
126 /* agent_find() is used to check if we have not */
127 /* two SNMP agents registered on the same UDP port */
129 Agent
*agent_find(Address
*address
)
134 for(ap
= first_agent
; ap
; ap
= ap
->next_agent
)
136 if(ap
->address
.sin_port
== address
->sin_port
)
146 /****************************************************************/