<% def comment(name, type) filter1 = proc { |c| c.type == type } filter2 = case type when :export, :function Proc.new { |c| c.function == name } when :file Proc.new { |c| true } when :global Proc.new { |c| c.variables.include? name } end @comments.select(&filter1).select(&filter2).shift end %> <% def safe(obj, default, *attrs) attrs.each do |attr| return default unless obj.respond_to? attr obj = obj.send(attr) end obj end %> <% def build_fn_name(name, colorize = 0) fn_str = '' if (!@functions[name][:namespace].nil?) if(colorize) fn_str += "" + @functions[name][:namespace] + "::" else fn_str += @functions[name][:namespace] + "::" end end if (!@functions[name][:object].nil?) if(colorize) fn_str += "" + @functions[name][:object] + "." else fn_str += @functions[name][:object] + "." end end if(colorize) color = "#50A40B" color = "#086E6E" if @functions[name][:fn_type] == "obj" fn_str += "" + @functions[name][:name] + "()" else fn_str += @functions[name][:name] end fn_str end %> nasldoc: nasl

Overview of <%= @current_file %>

<% unless @overview.nil? %> <% unless @overview.summary.nil? %>

<%= @overview.summary %>

<% end %> <% @overview.description.each do |paragraph| %>

<%= paragraph %>

<% end %> <% if @overview.signed %>

Signed

This library contains a signature, indicating that it is permitted to call trusted builtin functions.

The signature on this library has not been checked, so there is no guarantee it will run in Nessus.

<% end %> <% unless @overview.includes.empty? %>

Required Includes

These files must be included by the importing code.

    <% @overview.includes.sort.each do |inc| %>
  • <%= inc %>
  • <% end %>
<% end %> <% end %> <% unless @includes.empty? %>

Automatic Includes

These files are automatically included by the library.

    <% @includes.each do |inc| %>
  • <%= inc %>
  • <% end %>
<% end %> <% {Public: @globs_pub, Private: @globs_prv}.each do |name, list| %> <% unless list.empty? %>

<%= name %> Variable Summary

<% if name == :Public %>

Public variables are intended to be accessed by the code that imports this library.

<% else %>

Private variables are not intended to be accessed by the code that imports this library. There is no functional difference between private and public variables, only convention, and they may be accessed as normal.

<% end %> <% list.each do |name| %> <% end %>
Name Summary
<%= name %> <%= safe(comment(name, :global), "", :summary) %>
<% end %> <% end %> <% {Public: @funcs_pub, Private: @funcs_prv}.each do |name, list| %> <% unless list.empty? %>

<%= name %> Function Summary

<% if name == :Public %>

Public functions are intended to be called by the code that imports this library.

<% else %>

Private functions are not intended to be called by the code that imports this library. There is no functional difference between private and public functions, only convention, and they may be called as normal.

<% end %> <% list.keys.sort_by { |key| [@functions[key][:name]] }.each do |name| %> <% end %>
Name Summary
<%= build_fn_name(name, 1) %> <%= safe(comment(name, :function), "", :summary) %>
<% end %> <% end %> <% {Public: @globs_pub, Private: @globs_prv}.each do |name, list| %> <% unless list.empty? %>

<%= name %> Variable Details

<% list.each do |name| %>

<%= name %>

<% comm = comment(name, :global) %> <% unless comm.nil? %> <% unless comm.summary.nil? %>

Summary

<%= comm.summary %>

<% end %> <% unless comm.description.empty? %>

Description

<% comm.description.each do |para| %>

<%= para %>

<% end %> <% end %> <% unless comm.remarks.empty? %>

Remarks

<% comm.remarks.each do |rem| %>

<%= rem %>

<% end %> <% end %> <% unless comm.deprecated.nil? %>

Deprecated

<%= comm.deprecated %>

<% end %> <% unless comm.nessus.nil? %>

Nessus Version

<%= comm.nessus %>

<% end %> <% unless comm.categories.empty? %>

Categories

    <% comm.categories.sort.each do |cat| %>
  • <%= cat %>
  • <% end %>
<% end %> <% end %> top
<% end %> <% end %> <% end %> <% {Public: @funcs_pub, Private: @funcs_prv}.each do |name, list| %> <% unless list.empty? %>

<%= name %> Function Details

<% list.keys.sort.each do |name| %>

<%= @functions[name][:name] %>

<% comm = comment(name, :function) %> <% unless comm.nil? %> <% unless comm.summary.nil? %>

Summary

<%= comm.summary %>

<% end %> <% unless @functions[name][:namespace].nil? %>

Namespace

<%= @functions[name][:namespace] %>

<% end %> <% unless @functions[name][:object].nil? %>

Object

<%= @functions[name][:object] %>

<% end %> <% unless comm.description.empty? %>

Description

<% comm.description.each do |para| %>

<%= para %>

<% end %> <% end %> <% unless comm.remarks.empty? %>

Remarks

<% comm.remarks.each do |rem| %>

<%= rem %>

<% end %> <% end %> <% unless comm.deprecated.nil? %>

Deprecated

<%= comm.deprecated %>

<% end %> <% unless comm.nessus.nil? %>

Nessus Version

<%= comm.nessus %>

<% end %> <% unless comm.categories.empty? %>

Categories

    <% comm.categories.sort.each do |cat| %>
  • <%= cat %>
  • <% end %>
<% end %> <% unless comm.anonparams.empty? %>

Anonymous Parameters

<% comm.anonparams.sort.each do |name, block| %>
<%= name %>
<%= block %>
<% end %>
<% end %> <% end %> <% unless @functions[name].nil? || @functions[name].empty? %>

Named Parameters

<% @functions[name][:params].sort.each do |param| %>
<%= param.name %>
<% unless comm.nil? || !comm.params.has_key?(param.name) %>
<%= comm.params[param.name] %>
<% end %> <% end %>
<% end %> <% unless comm.nil? || comm.return.nil? %>

Return Value

<%= comm.return %>

<% end %>

Code

<% unless @functions[name][:code].nil? %>
<%= CGI::escapeHTML(@functions[name][:code]) %>
<% end %>
		
top
<% end %> <% end %> <% end %>