OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [net/] [snmp/] [agent/] [v2_0/] [src/] [snmptask.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1254 phoenix
//==========================================================================
2
//
3
//      ./agent/current/src/snmptask.c
4
//
5
//
6
//==========================================================================
7
//####ECOSGPLCOPYRIGHTBEGIN####
8
// -------------------------------------------
9
// This file is part of eCos, the Embedded Configurable Operating System.
10
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
11
//
12
// eCos is free software; you can redistribute it and/or modify it under
13
// the terms of the GNU General Public License as published by the Free
14
// Software Foundation; either version 2 or (at your option) any later version.
15
//
16
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
17
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19
// for more details.
20
//
21
// You should have received a copy of the GNU General Public License along
22
// with eCos; if not, write to the Free Software Foundation, Inc.,
23
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24
//
25
// As a special exception, if other files instantiate templates or use macros
26
// or inline functions from this file, or you compile this file and link it
27
// with other works to produce a work based on this file, this file does not
28
// by itself cause the resulting work to be covered by the GNU General Public
29
// License. However the source code for this file must still be made available
30
// in accordance with section (3) of the GNU General Public License.
31
//
32
// This exception does not invalidate any other reasons why a work based on
33
// this file might be covered by the GNU General Public License.
34
//
35
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
36
// at http://sources.redhat.com/ecos/ecos-license/
37
// -------------------------------------------
38
//####ECOSGPLCOPYRIGHTEND####
39
//####UCDSNMPCOPYRIGHTBEGIN####
40
//
41
// -------------------------------------------
42
//
43
// Portions of this software may have been derived from the UCD-SNMP
44
// project,  <http://ucd-snmp.ucdavis.edu/>  from the University of
45
// California at Davis, which was originally based on the Carnegie Mellon
46
// University SNMP implementation.  Portions of this software are therefore
47
// covered by the appropriate copyright disclaimers included herein.
48
//
49
// The release used was version 4.1.2 of May 2000.  "ucd-snmp-4.1.2"
50
// -------------------------------------------
51
//
52
//####UCDSNMPCOPYRIGHTEND####
53
//==========================================================================
54
//#####DESCRIPTIONBEGIN####
55
//
56
// Author(s):    hmt
57
// Contributors: hmt
58
// Date:         2000-05-30
59
// Purpose:      Port of UCD-SNMP distribution to eCos.
60
// Description:  
61
//              
62
//
63
//####DESCRIPTIONEND####
64
//
65
//==========================================================================
66
/********************************************************************
67
       Copyright 1989, 1991, 1992 by Carnegie Mellon University
68
 
69
                          Derivative Work -
70
Copyright 1996, 1998, 1999, 2000 The Regents of the University of California
71
 
72
                         All Rights Reserved
73
 
74
Permission to use, copy, modify and distribute this software and its
75
documentation for any purpose and without fee is hereby granted,
76
provided that the above copyright notice appears in all copies and
77
that both that copyright notice and this permission notice appear in
78
supporting documentation, and that the name of CMU and The Regents of
79
the University of California not be used in advertising or publicity
80
pertaining to distribution of the software without specific written
81
permission.
82
 
83
CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
84
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
85
WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL CMU OR
86
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
87
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
88
FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
89
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
90
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
91
*********************************************************************/
92
//==========================================================================
93
//
94
//      snmptask.c
95
//
96
//      eCos wrapper for the SNMP daemon
97
//
98
//==========================================================================
99
//####ECOSGPLCOPYRIGHTBEGIN####
100
// -------------------------------------------
101
// This file is part of eCos, the Embedded Configurable Operating System.
102
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
103
//
104
// eCos is free software; you can redistribute it and/or modify it under
105
// the terms of the GNU General Public License as published by the Free
106
// Software Foundation; either version 2 or (at your option) any later version.
107
//
108
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
109
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
110
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
111
// for more details.
112
//
113
// You should have received a copy of the GNU General Public License along
114
// with eCos; if not, write to the Free Software Foundation, Inc.,
115
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
116
//
117
// As a special exception, if other files instantiate templates or use macros
118
// or inline functions from this file, or you compile this file and link it
119
// with other works to produce a work based on this file, this file does not
120
// by itself cause the resulting work to be covered by the GNU General Public
121
// License. However the source code for this file must still be made available
122
// in accordance with section (3) of the GNU General Public License.
123
//
124
// This exception does not invalidate any other reasons why a work based on
125
// this file might be covered by the GNU General Public License.
126
//
127
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
128
// at http://sources.redhat.com/ecos/ecos-license/
129
// -------------------------------------------
130
//####ECOSGPLCOPYRIGHTEND####
131
//####BSDCOPYRIGHTBEGIN####
132
//
133
// -------------------------------------------
134
//
135
// Portions of this software may have been derived from OpenBSD or other sources,
136
// and are covered by the appropriate copyright disclaimers included herein.
137
//
138
// -------------------------------------------
139
//
140
//####BSDCOPYRIGHTEND####
141
//==========================================================================
142
//#####DESCRIPTIONBEGIN####
143
//
144
// Author(s):    gthomas
145
// Contributors: gthomas
146
// Date:         2000-01-10
147
// Purpose:      
148
// Description:  
149
//              
150
//
151
//####DESCRIPTIONEND####
152
//
153
//==========================================================================
154
 
155
#include <cyg/hal/hal_arch.h>
156
#include <cyg/kernel/kapi.h>
157
 
158
#include <pkgconf/system.h>
159
#include CYGDAT_NET_STACK_CFG
160
 
161
#define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL + 102400
162
static char netsnmp_stack[STACK_SIZE];
163
static cyg_thread netsnmp_thread_data;
164
static cyg_handle_t netsnmp_thread_handle;
165
 
166
 
167
 
168
 
169
externC void (*snmpd_reinit_function)( void );
170
 
171
void (*snmpd_reinit_function)( void ) = NULL;
172
 
173
 
174
externC void snmpd( void (*initfunc)( void ) );
175
 
176
static void
177
snmpdloop( cyg_addrword_t data )
178
{
179
    while ( 1 )
180
        snmpd(snmpd_reinit_function);
181
}
182
 
183
// Network initialization
184
//   This function is called during system initialization to setup the whole
185
// networking environment.
186
//
187
 
188
void
189
cyg_net_snmp_init(void)
190
{
191
 
192
    // Create network background thread
193
    cyg_thread_create(CYGPKG_NET_THREAD_PRIORITY+1, // Priority, just lower than the net
194
                      snmpdloop,                // entry
195
                      0,                        // entry parameter
196
                      "snmpd",                  // Name
197
                      &netsnmp_stack[0],        // Stack
198
                      STACK_SIZE,               // Size
199
                      &netsnmp_thread_handle,   // Handle
200
                      &netsnmp_thread_data      // Thread data structure
201
            );
202
    cyg_thread_resume(netsnmp_thread_handle);    // Start it
203
    // Done
204
 
205
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.