comparison packages/net/snmp/agent/current/src/snmptask.c @ 103:95f3e12a6327 ecos-sw-2000-06-23

Merge from eCos master repository on 2000-06-23-16:41:10-BST
author jlarmour
date Fri, 23 Jun 2000 17:06:31 +0000
parents
children 5a0cc6c243a9
comparison
equal deleted inserted replaced
102:6409b6d94dd7 103:95f3e12a6327
1 //==========================================================================
2 //
3 // ./agent/current/src/snmptask.c
4 //
5 //
6 //==========================================================================
7 //####COPYRIGHTBEGIN####
8 //
9 // -------------------------------------------
10 // The contents of this file are subject to the Red Hat eCos Public License
11 // Version 1.1 (the "License"); you may not use this file except in
12 // compliance with the License. You may obtain a copy of the License at
13 // http://www.redhat.com/
14 //
15 // Software distributed under the License is distributed on an "AS IS"
16 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
17 // License for the specific language governing rights and limitations under
18 // the License.
19 //
20 // The Original Code is eCos - Embedded Configurable Operating System,
21 // released September 30, 1998.
22 //
23 // The Initial Developer of the Original Code is Red Hat.
24 // Portions created by Red Hat are
25 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
26 // All Rights Reserved.
27 // -------------------------------------------
28 //
29 //####COPYRIGHTEND####
30 //####UCDSNMPCOPYRIGHTBEGIN####
31 //
32 // -------------------------------------------
33 //
34 // Portions of this software may have been derived from the UCD-SNMP
35 // project, <http://ucd-snmp.ucdavis.edu/> from the University of
36 // California at Davis, which was originally based on the Carnegie Mellon
37 // University SNMP implementation. Portions of this software are therefore
38 // covered by the appropriate copyright disclaimers included herein.
39 //
40 // The release used was version 4.1.2 of May 2000. "ucd-snmp-4.1.2"
41 // -------------------------------------------
42 //
43 //####UCDSNMPCOPYRIGHTEND####
44 //==========================================================================
45 //#####DESCRIPTIONBEGIN####
46 //
47 // Author(s): hmt
48 // Contributors: hmt
49 // Date: 2000-05-30
50 // Purpose: Port of UCD-SNMP distribution to eCos.
51 // Description:
52 //
53 //
54 //####DESCRIPTIONEND####
55 //
56 //==========================================================================
57 /********************************************************************
58 Copyright 1989, 1991, 1992 by Carnegie Mellon University
59
60 Derivative Work -
61 Copyright 1996, 1998, 1999, 2000 The Regents of the University of California
62
63 All Rights Reserved
64
65 Permission to use, copy, modify and distribute this software and its
66 documentation for any purpose and without fee is hereby granted,
67 provided that the above copyright notice appears in all copies and
68 that both that copyright notice and this permission notice appear in
69 supporting documentation, and that the name of CMU and The Regents of
70 the University of California not be used in advertising or publicity
71 pertaining to distribution of the software without specific written
72 permission.
73
74 CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
75 WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
76 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL CMU OR
77 THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
78 INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
79 FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
80 CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
81 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
82 *********************************************************************/
83 //==========================================================================
84 //
85 // snmptask.c
86 //
87 // eCos wrapper for the SNMP daemon
88 //
89 //==========================================================================
90 //####COPYRIGHTBEGIN####
91 //
92 // -------------------------------------------
93 // The contents of this file are subject to the Red Hat eCos Public License
94 // Version 1.1 (the "License"); you may not use this file except in
95 // compliance with the License. You may obtain a copy of the License at
96 // http://www.redhat.com/
97 //
98 // Software distributed under the License is distributed on an "AS IS"
99 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
100 // License for the specific language governing rights and limitations under
101 // the License.
102 //
103 // The Original Code is eCos - Embedded Configurable Operating System,
104 // released September 30, 1998.
105 //
106 // The Initial Developer of the Original Code is Red Hat.
107 // Portions created by Red Hat are
108 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
109 // All Rights Reserved.
110 // -------------------------------------------
111 //
112 //####COPYRIGHTEND####
113 //####BSDCOPYRIGHTBEGIN####
114 //
115 // -------------------------------------------
116 //
117 // Portions of this software may have been derived from OpenBSD or other sources,
118 // and are covered by the appropriate copyright disclaimers included herein.
119 //
120 // -------------------------------------------
121 //
122 //####BSDCOPYRIGHTEND####
123 //==========================================================================
124 //#####DESCRIPTIONBEGIN####
125 //
126 // Author(s): gthomas
127 // Contributors: gthomas
128 // Date: 2000-01-10
129 // Purpose:
130 // Description:
131 //
132 //
133 //####DESCRIPTIONEND####
134 //
135 //==========================================================================
136
137
138 // Support routines, etc., used by network code
139
140 #include <sys/param.h>
141 #include <sys/malloc.h>
142 #include <sys/mbuf.h>
143 #include <sys/kernel.h>
144 #include <sys/domain.h>
145 #include <sys/protosw.h>
146 #include <net/netisr.h>
147
148 #include <machine/cpu.h>
149
150 #include <cyg/infra/diag.h>
151 #include <cyg/hal/hal_intr.h>
152 #include <cyg/kernel/kapi.h>
153
154
155
156
157 #define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL + 102400
158 static char netsnmp_stack[STACK_SIZE];
159 static cyg_thread netsnmp_thread_data;
160 static cyg_handle_t netsnmp_thread_handle;
161
162
163
164
165
166
167 externC void snmpd( void );
168
169 // Network initialization
170 // This function is called during system initialization to setup the whole
171 // networking environment.
172 //
173
174 void
175 cyg_net_snmp_init(void)
176 {
177
178 // Create network background thread
179 cyg_thread_create(CYGPKG_NET_THREAD_PRIORITY-2, // Priority
180 snmpd, // entry
181 0, // entry parameter
182 "snmpd", // Name
183 &netsnmp_stack[0], // Stack
184 STACK_SIZE, // Size
185 &netsnmp_thread_handle, // Handle
186 &netsnmp_thread_data // Thread data structure
187 );
188 cyg_thread_resume(netsnmp_thread_handle); // Start it
189 // Done
190
191 }