Code Search for Developers
 
 
  

agent_2snmp__perl_8c-source.html from net-snmp at Krugle


Show agent_2snmp__perl_8c-source.html syntax highlighted

<!--#set var="section" value="development" -->
<!--#include virtual="/page-top.html" -->
<!-- CONTENT START -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>snmp_perl.c Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor=white bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.11 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>snmp_perl.c</h1><div class="fragment"><pre>00001 <font class="preprocessor">#include &lt;EXTERN.h&gt;</font>
00002 <font class="preprocessor">#include "perl.h"</font>
00003 
00004 <font class="preprocessor">#include &lt;net-snmp/net-snmp-config.h&gt;</font>
00005 <font class="preprocessor">#include &lt;net-snmp/net-snmp-includes.h&gt;</font>
00006 <font class="preprocessor">#include &lt;net-snmp/agent/net-snmp-agent-includes.h&gt;</font>
00007 
00008 <font class="keyword">static</font> PerlInterpreter *my_perl;
00009 
00010 <font class="keywordtype">void</font> boot_DynaLoader (CV* cv);
00011  
00012 <font class="keywordtype">void</font>
00013 xs_init(<font class="keywordtype">void</font>)<font class="keyword"></font>
00014 {
00015     <font class="keywordtype">char</font> myfile[] = __FILE__;
00016     <font class="keywordtype">char</font> modulename[] = <font class="stringliteral">"DynaLoader::boot_DynaLoader"</font>;
00017     <font class="comment">/* DynaLoader is a special case */</font>
00018     newXS(modulename, boot_DynaLoader, myfile);
00019 }
00020 
00021 
00022 <font class="keywordtype">void</font>
00023 do_something_perlish(<font class="keywordtype">char</font> *something)<font class="keyword"></font>
00024 {
00025     DEBUGMSGTL((<font class="stringliteral">"perl"</font>, <font class="stringliteral">"calling perl\n"</font>));
00026     eval_pv(something, TRUE);
00027     DEBUGMSGTL((<font class="stringliteral">"perl"</font>, <font class="stringliteral">"finished calling perl\n"</font>));
00028 }
00029 
00030 <font class="keywordtype">void</font> perl_config_handler(<font class="keyword">const</font> <font class="keywordtype">char</font> *token, <font class="keywordtype">char</font> *line)<font class="keyword"> </font>
00031 {
00032     do_something_perlish(line);
00033 }
00034 
00035 <font class="keywordtype">void</font>
00036 init_perl(<font class="keywordtype">void</font>)<font class="keyword"> </font>
00037 {
00038     <font class="keyword">const</font> <font class="keywordtype">char</font> *embedargs[] = { <font class="stringliteral">""</font>, <font class="stringliteral">"snmp_perl.pl"</font> };
00039 
00040     DEBUGMSGTL((<font class="stringliteral">"perl"</font>, <font class="stringliteral">"initializing perl\n"</font>));
00041     my_perl = perl_alloc();
00042     perl_construct(my_perl);
00043     perl_parse(my_perl, xs_init, 2, (<font class="keywordtype">char</font> **) embedargs, NULL);
00044     perl_run(my_perl);
00045     DEBUGMSGTL((<font class="stringliteral">"perl"</font>, <font class="stringliteral">"done initializing perl\n"</font>));
00046 
00047     <font class="comment">/* register config handlers */</font>
00048     snmpd_register_config_handler(<font class="stringliteral">"perl"</font>, perl_config_handler, NULL,
00049                                   <font class="stringliteral">"PERLCODE"</font>);
00050 }
00051 
00052 <font class="keywordtype">void</font>
00053 shutdown_perl(<font class="keywordtype">void</font>)<font class="keyword"> </font>
00054 {
00055     DEBUGMSGTL((<font class="stringliteral">"perl"</font>, <font class="stringliteral">"shutting down perl\n"</font>));
00056     perl_destruct(my_perl);
00057     perl_free(my_perl);
00058     DEBUGMSGTL((<font class="stringliteral">"perl"</font>, <font class="stringliteral">"finished shutting down perl\n"</font>));
00059 }
<!--#include virtual="/sfbutton.html" -->
</pre></div><hr><address><small><!--#include virtual="/sfbutton.html" -->
 Thu Feb 7 12:57:13 2002 for net-snmp by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.11 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>
<!--#include virtual="/sfbutton.html" -->
<!-- CONTENT END -->
<!--#include virtual="/page-bottom.html" -->





See more files for this project here

net-snmp

net-snmp provides tools and libraries relating to the Simple Network\r\nManagement Protocol including: An extensible agent, An SNMP library,\r\ntools to request or set information from SNMP agents, tools to\r\ngenerate and handle SNMP traps, etc.\r\n

Project homepage: http://sourceforge.net/projects/net-snmp
Programming language(s): C,Perl,Shell Script
License: other

  mfd/
  acconfig_8h-source.html
  acconfig_8h.html
  agent_2snmp__perl_8c-source.html
  agent__callbacks_8h-source.html
  agent__callbacks_8h.html
  agent__handler_8c-source.html
  agent__handler_8c.html
  agent__handler_8h-source.html
  agent__handler_8h.html
  agent__index_8c-source.html
  agent__index_8c.html
  agent__index_8h-source.html
  agent__index_8h.html
  agent__module__config_8h-source.html
  agent__read__config_8c-source.html
  agent__read__config_8c.html
  agent__read__config_8h-source.html
  agent__read__config_8h.html
  agent__registry_8c-source.html
  agent__registry_8c.html
  agent__registry_8h-source.html
  agent__registry_8h.html
  agent__trap_8c-source.html
  agent__trap_8c.html
  agent__trap_8h-source.html
  agent__trap_8h.html
  all__helpers_8c-source.html
  all__helpers_8h-source.html
  annotated.html
  asn1_8c-source.html
  asn1_8h-source.html
  auto__nlist_8c-source.html
  auto__nlist_8c.html
  auto__nlist_8h-source.html
  auto__nlist_8h.html
  autonlist_8h-source.html
  autonlist_8h.html
  baby__steps_8c-source.html
  baby__steps_8h-source.html
  blah.html
  bulk__to__next_8c-source.html
  bulk__to__next_8h-source.html
  cache__handler_8c-source.html
  cache__handler_8h-source.html
  callback_8c-source.html
  callback_8h-source.html
  check__varbind_8c-source.html
  check__varbind_8h-source.html
  cmu__compat_8c-source.html
  cmu__compat_8h-source.html
  config_8h-source.html
  config_8h.html
  config__api_8h-source.html
  container_8c-source.html
  container_8h-source.html
  container__binary__array_8c-source.html
  container__binary__array_8h-source.html
  container__iterator_8c-source.html
  container__iterator_8h-source.html
  container__list__ssll_8c-source.html
  container__list__ssll_8h-source.html
  container__null_8c-source.html
  container__null_8h-source.html
  data__list_8c-source.html
  data__list_8h-source.html
  data__set_8c-example.html
  data__set_8c-source.html
  data__set_8h-source.html
  debug__handler_8c-source.html
  debug__handler_8h-source.html
  default__store_8c-source.html
  default__store_8h-source.html
  default_store.html
  definitions_8h-source.html
  delayed__instance_8c-example.html
  delayed__instance_8c-source.html
  delayed__instance_8h-source.html
  deprecated.html
  dir_000000.html
  dir_000001.html
  dir_000002.html
  dir_000003.html
  dir_000004.html
  dir_000005.html
  dir_000006.html
  dir_000007.html
  dir_000008.html
  doxygen.css
  doxygen.gif
  doxygen.png
  ds__agent_8h-source.html
  ds__agent_8h.html
  example_8c-source.html
  example_8h-source.html
  examples.html
  factory_8h-source.html
  fd__event__manager_8c-source.html
  fd__event__manager_8h-source.html
  file__utils_8c-source.html
  file__utils_8h-source.html
  files.html