499 views
Skip to first unread message

Stefan Schulte

unread,
Dec 23, 2010, 7:04:12 PM12/23/10
to puppe...@googlegroups.com
I talked about a resourcetype for /etc/services on the list and a
resourcetype with name and protoco as a composite key seems be be the
best way to implement it. This patch requires:

#5605
#5661
#5662

I have no idea if this works on Mac OS X because I just tested it with a
standard linux /etc/services.

Stefan Schulte

unread,
Dec 23, 2010, 7:04:15 PM12/23/10
to puppe...@googlegroups.com
I contrast to the description you cannot use the same title for
different resources. Thats what title_patterns are for: To use one title
to specify all key_attributes. So if one wants to specify a resource
with two protocols, the easiest way to this is to just write

port { 'telnet:tcp': number => 23, ensure => present }
port { 'telnet:udp': number => 23, ensure => present }

The titlepattern will both set name ("telnet") and protocol (:tcp or
:udp)

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660
lib/puppet/type/port.rb | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/puppet/type/port.rb b/lib/puppet/type/port.rb
index 2087d7c..e2a4afa 100755
--- a/lib/puppet/type/port.rb
+++ b/lib/puppet/type/port.rb
@@ -33,10 +33,11 @@ module Puppet
newparam(:protocol) do
desc "The protocols the port uses. Valid values are *udp* and *tcp*.
Most services have both protocols, but not all. If you want both
- protocols you have to define two resources. You can define both
- resources with the same title as long as the combination of
- resourcetitle and protocol is uniq. Keep in mind that if another
- resource requires Port['title'] it requires both resources"
+ protocols you have to define two resources. Remeber that you cannot
+ specify two resources with the same title but you can use a title
+ to set both, name and protocol if you use ':' as a seperator. So
+ port { 'telnet:tcp': ... } sets both name and protocol and you dont
+ have to specify them explicitly then"

newvalues :tcp, :udp

--
1.7.3.4

Stefan Schulte

unread,
Dec 23, 2010, 7:04:14 PM12/23/10
to puppe...@googlegroups.com
This provider uses parsedfile to parse entries in /etc/services. Because
we use composite keys we have to provide an individual match method to
find resources for a single record.

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660

lib/puppet/provider/port/parsed.rb | 228 ++----
spec/unit/provider/port/parsed_spec.rb | 296 ++++++
test/data/providers/port/parsed/nonuniq | 6 +
test/data/providers/port/parsed/realworld_linux | 1179 +++++++++++++++++++++++
test/data/providers/port/parsed/uniq | 7 +
5 files changed, 1546 insertions(+), 170 deletions(-)
create mode 100644 spec/unit/provider/port/parsed_spec.rb
create mode 100644 test/data/providers/port/parsed/nonuniq
create mode 100644 test/data/providers/port/parsed/realworld_linux
create mode 100644 test/data/providers/port/parsed/uniq

diff --git a/lib/puppet/provider/port/parsed.rb b/lib/puppet/provider/port/parsed.rb
index 5c973b6..ae6fba7 100755
--- a/lib/puppet/provider/port/parsed.rb
+++ b/lib/puppet/provider/port/parsed.rb
@@ -1,173 +1,61 @@
require 'puppet/provider/parsedfile'

-#services = nil
-#case Facter.value(:operatingsystem)
-#when "Solaris"; services = "/etc/inet/services"
-#else
-# services = "/etc/services"
-#end
-#
-#Puppet::Type.type(:port).provide(:parsed,
-# :parent => Puppet::Provider::ParsedFile,
-# :default_target => services,
-# :filetype => :flat
-#) do
-# text_line :comment, :match => /^\s*#/
-# text_line :blank, :match => /^\s*$/
-#
-# # We're cheating horribly here -- we don't support ddp, because it assigns
-# # the same number to already-used names, and the same name to different
-# # numbers.
-# text_line :ddp, :match => /^\S+\s+\d+\/ddp/
-#
-# # Also, just ignore the lines on OS X that don't have service names.
-# text_line :funky_darwin, :match => /^\s+\d+\//
-#
-# # We have to manually parse the line, since it's so darn complicated.
-# record_line :parsed, :fields => %w{name port protocols alias description},
-# :optional => %w{alias description} do |line|
-# if line =~ /\/ddp/
-# raise "missed ddp in #{line}"
-# end
-# # The record might contain multiple port lines separated by \n.
-# hashes = line.split("\n").collect { |l| parse_port(l) }
-#
-# # It's easy if there's just one hash.
-# if hashes.length == 1
-# return hashes.shift
-# end
-#
-# # Else, merge the two records into one.
-# return port_merge(*hashes)
-# end
-#
-# # Override how we split into lines, so that we always treat both protocol
-# # lines as a single line. This drastically simplifies merging the two lines
-# # into one record.
-# def self.lines(text)
-# names = {}
-# lines = []
-#
-# # We organize by number, because that's apparently how the ports work.
-# # You'll never be able to use Puppet to manage multiple entries
-# # with the same name but different numbers, though.
-# text.split("\n").each do |line|
-# if line =~ /^([-\w]+)\s+(\d+)\/[^d]/ # We want to skip ddp proto stuff
-# names[$1] ||= []
-# names[$1] << line
-# lines << [:special, $1]
-# else
-# lines << line
-# end
-# end
-#
-# # Now, return each line in order, but join the ones with the same name
-# lines.collect do |line|
-# if line.is_a?(Array)
-# name = line[1]
-# if names[name]
-# t = names[name].join("\n")
-# names.delete(name)
-# t
-# end
-# else
-# line
-# end
-# end.reject { |l| l.nil? }
-# end
-#
-# # Parse a single port line, returning a hash.
-# def self.parse_port(line)
-# hash = {}
-# if line.sub!(/^(\S+)\s+(\d+)\/(\w+)\s*/, '')
-# hash[:name] = $1
-# hash[:number] = $2
-# hash[:protocols] = [$3]
-#
-# unless line == ""
-# line.sub!(/^([^#]+)\s*/) do |value|
-# aliases = $1
-#
-# # Remove any trailing whitespace
-# aliases.strip!
-# unless aliases =~ /^\s*$/
-# hash[:alias] = aliases.split(/\s+/)
-# end
-#
-# ""
-# end
-#
-# line.sub!(/^\s*#\s*(.+)$/) do |value|
-# desc = $1
-# unless desc =~ /^\s*$/
-# hash[:description] = desc.sub(/\s*$/, '')
-# end
-#
-# ""
-# end
-# end
-# else
-# if line =~ /^\s+\d+/ and
-# Facter["operatingsystem"].value == "Darwin"
-# #Puppet.notice "Skipping wonky OS X port entry %s" %
-# # line.inspect
-# next
-# end
-# Puppet.notice "Ignoring unparseable line '#{line}' in #{self.target}"
-# end
-#
-# if hash.empty?
-# return nil
-# else
-# return hash
-# end
-# end
-#
-# # Merge two records into one.
-# def self.port_merge(one, two)
-# keys = [one.keys, two.keys].flatten.uniq
-#
-# # We'll be returning the 'one' hash. so make any necessary modifications
-# # to it.
-# keys.each do |key|
-# # The easy case
-# if one[key] == two[key]
-# next
-# elsif one[key] and ! two[key]
-# next
-# elsif ! one[key] and two[key]
-# one[key] = two[key]
-# elsif one[key].is_a?(Array) and two[key].is_a?(Array)
-# one[key] = [one[key], two[key]].flatten.uniq
-# else
-# # Keep the info from the first hash, so don't do anything
-# #Puppet.notice "Cannot merge %s in %s with %s" %
-# # [key, one.inspect, two.inspect]
-# end
-# end
-#
-# return one
-# end
-#
-# # Convert the current object into one or more services entry.
-# def self.to_line(hash)
-# unless hash[:record_type] == :parsed
-# return super
-# end
-#
-# # Strangely, most sites seem to use tabs as separators.
-# hash[:protocols].collect { |proto|
-# str = "#{hash[:name]}\t\t#{hash[:number]}/#{proto}"
-#
-# if value = hash[:alias] and value != :absent
-# str += "\t\t#{value.join(" ")}"
-# end
-#
-# if value = hash[:description] and value != :absent
-# str += "\t# #{value}"
-# end
-# str
-# }.join("\n")
-# end
-#end
+services = nil
+case Facter.value(:operatingsystem)
+when "Solaris"
+ services = "/etc/inet/services"
+else
+ services = "/etc/services"
+end

+Puppet::Type.type(:port).provide(:parsed, :parent => Puppet::Provider::ParsedFile,
+ :default_target => services, :filetype => :flat) do
+
+ text_line :comment, :match => /^\s*#/
+ text_line :blank, :match => /^\s*$/
+
+ record_line :parsed, :fields => %w{name number protocol port_aliases description},
+ :optional => %w{port_aliases description},
+ :match => /^(\S*)\s+(\d*)\/(\S*)\s*(.*?)?\s*(?:#\s*(.*))?$/,
+ :post_parse => proc { |hash|
+ hash[:protocol] = hash[:protocol].intern if hash[:protocol]
+ hash[:description] = '' if hash[:description].nil? or hash[:description] == :absent
+ unless hash[:port_aliases].nil? or hash[:port_aliases] == :absent
+ hash[:port_aliases].gsub!(/\s+/,' ') # Change delimiter
+ end
+ },
+ :to_line => proc { |hash|
+ [:name, :number, :protocol].each do |n|
+ raise Puppet::Error, "#{n} is a required attribute for port but not included in #{hash.inspect}" unless hash[n] and hash[n] != :absent
+ end
+
+ str = "#{hash[:name]}\t#{hash[:number]}/#{hash[:protocol]}"
+ if hash.include? :port_aliases and !hash[:port_aliases].nil? and hash[:port_aliases] != :absent
+ str += "\t#{hash[:port_aliases]}"
+ end
+ if hash.include? :description and !hash[:description].empty?
+ str += "\t# #{hash[:description]}"
+ end
+ str
+ }
+
+ # This method is important for prefetching and is called from the parsedfile provider.
+ # We get one record (one line of /etc/services) and a hash of resources (what the user
+ # specified in manifests). This hash is build in transaction.rb and uses uniqueness_key
+ # as a hashkey.
+ # Normally the parsedfileprovider loops over every record and uses record[:name] to
+ # find a corresponding resources[name]. That works if we only have one namevar
+ # because uniqueness_key of this resource will equal record[:name]. Because we use
+ # a composite key the parsedfile provider would never find a resource that matches
+ # a given record.
+ # Even worse: The parsedfileprovider cannot calculate the uniqueness_key of a
+ # specific record.
+ def self.match(record,resources)
+ # This should never happen but who knows
+ return false unless name = record[:name] and protocol = record[:protocol]
+
+ # We now calculate the uniqueness_key of the resource we want to find
+ uniq_key = [name, protocol]
+ resources[uniq_key] # will be nil if the user doesnt manage record
+ end
+end
diff --git a/spec/unit/provider/port/parsed_spec.rb b/spec/unit/provider/port/parsed_spec.rb
new file mode 100644
index 0000000..82ec307
--- /dev/null
+++ b/spec/unit/provider/port/parsed_spec.rb
@@ -0,0 +1,296 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+require 'puppet_spec/files'
+require 'puppettest/support/utils'
+require 'puppettest/fileparsing'
+require 'puppet/property/ordered_list'
+
+provider_class = Puppet::Type.type(:port).provider(:parsed)
+
+describe provider_class do
+ include PuppetSpec::Files
+ include PuppetTest::Support::Utils
+ include PuppetTest::FileParsing
+
+ before do
+ @host_class = Puppet::Type.type(:port)
+ @provider = @host_class.provider(:parsed)
+ @servicesfile = tmpfile('services')
+ @provider.stubs(:default_target).returns @servicesfile
+ @provider.any_instance.stubs(:target).returns @servicesfile
+ end
+
+ after :each do
+ @provider.initvars
+ end
+
+ def mkport(args)
+ portresource = Puppet::Type::Port.new(:name => args[:name], :protocol => args[:protocol])
+ portresource.stubs(:should).with(:target).returns @servicesfile
+
+ # Using setters of provider
+ port = @provider.new(portresource)
+ args.each do |property,value|
+ value = value.join(' ') if property == :port_aliases and value.is_a?(Array)
+ port.send("#{property}=", value)
+ end
+ port
+ end
+
+ def genport(port)
+ @provider.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
+ File.stubs(:chown)
+ File.stubs(:chmod)
+ Puppet::Util::SUIDManager.stubs(:asuser).yields
+ port.flush
+ @provider.target_object(@servicesfile).read
+ end
+
+ describe "when parsing a line with name port and protocol" do
+
+ before do
+ @example_line = "telnet \t 23/udp"
+ end
+
+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == 'telnet'
+ end
+
+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == '23'
+ end
+
+ it "should extract protocol udp from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == :udp
+ end
+
+ it "should extrace protocol tcp from third field" do
+ @provider.parse_line('telnet 23/tcp')[:protocol].should == :tcp
+ end
+
+ it "should drop trailing spaces" do
+ @provider.parse_line('telnet 23/tcp ')[:protocol].should == :tcp
+ end
+
+ it "should handle different delimiters" do
+ @result = ['telnet','23',:tcp ]
+ [
+ "telnet 23/tcp",
+ "telnet\t23/tcp",
+ "telnet \t23/tcp",
+ "telnet\t 23/tcp",
+ "telnet \t 23/tcp\t\t"
+ ].each do |sample|
+ hash = @provider.parse_line(sample)
+ hash[:name].should == @result[0]
+ hash[:number].should == @result[1]
+ hash[:protocol].should == @result[2]
+ hash[:description].should == ''
+ end
+ end
+
+ end
+
+ describe "when parsing a line with name, port, protocol, description" do
+
+ before do
+ @example_line = "telnet \t 23/udp # Telnet"
+ end
+
+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == 'telnet'
+ end
+
+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == '23'
+ end
+
+ it "should extract protocol from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == :udp
+ end
+
+ it "should extract description after the first #" do
+ @provider.parse_line(@example_line)[:description].should == 'Telnet'
+ end
+
+ it "should correctly set description with multiple #" do
+ @provider.parse_line('telnet 23/udp # My # desc')[:description].should == 'My # desc'
+ end
+
+ it "should handle different delimiters" do
+ @result = ['telnet', '23', :udp, 'My # desc' ]
+ [
+ "telnet 23/udp # My # desc",
+ "telnet\t 23/udp\t# My # desc",
+ "telnet \t23/udp #\tMy # desc",
+ "telnet \t \t 23/udp \t \t# \tMy # desc"
+ ].each do |sample|
+ hash = @provider.parse_line(sample)
+ hash[:name].should == @result[0]
+ hash[:number].should == @result[1]
+ hash[:protocol].should == @result[2]
+ hash[:description].should == @result[3]
+ end
+
+ end
+
+ end
+
+ describe "when parsing a line with name, number, procotol and aliases" do
+
+ before do
+ @example_line = "telnet \t 23/udp alias1 alias2"
+ end
+
+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == 'telnet'
+ end
+
+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == '23'
+ end
+
+ it "should extract protocol from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == :udp
+ end
+
+ it "should extract single alias" do
+ @example_line = "telnet \t 23/udp alias1"
+ @provider.parse_line(@example_line)[:port_aliases].should == 'alias1'
+ end
+
+ it "should extract multiple aliases" do
+ @provider.parse_line(@example_line)[:port_aliases].should == 'alias1 alias2'
+ end
+
+ it "should convert delimiter to single space" do
+ @provider.parse_line("telnet 23/udp alias1\t\t alias2\talias3 alias4")[:port_aliases].should == 'alias1 alias2 alias3 alias4'
+ end
+
+ it "should set port_aliases to :absent if there is none" do
+ @provider.parse_line("telnet 23/udp")[:port_aliases].should == :absent
+ @provider.parse_line("telnet 23/udp ")[:port_aliases].should == :absent
+ @provider.parse_line("telnet 23/udp # Bazinga!")[:port_aliases].should == :absent
+ end
+
+ end
+
+ describe "when parsing a line with name, number, protocol, aliases and description" do
+
+ before do
+ @example_line = "telnet \t 23/udp alias1 alias2 # Tel#net"
+ @result = ['telnet','23',:udp,'alias1 alias2','Tel#net']
+ end
+
+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == @result[0]
+ end
+
+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == @result[1]
+ end
+
+ it "should extract protocol from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == @result[2]
+ end
+
+ it "should extract aliases from forth field" do
+ @provider.parse_line(@example_line)[:port_aliases].should == @result[3]
+ end
+
+ it "should extract description from the fifth field" do
+ @provider.parse_line(@example_line)[:description].should == @result[4]
+ end
+
+ end
+
+ describe "when operating on /etc/services like files" do
+
+ it "should be able to parse files with uniq port names" do
+ fakedataparse(fakefile('data/providers/port/parsed/uniq'))
+ end
+
+ it "should be able to parse files with non uniq names" do
+ fakedataparse(fakefile('data/providers/port/parsed/nonuniq'))
+ end
+
+ it "should be able to parse samplefile from linux" do
+ fakedataparse(fakefile('data/providers/port/parsed/realworld_linux'))
+ end
+
+ it "should be able to match resources and provider by multiple keys" do
+
+ end
+
+ end
+
+ it "should be able to generate a simple services entry" do
+ port = mkport(
+ :name => 'telnet',
+ :protocol => :tcp,
+ :number => '23',
+ :ensure => :present
+ )
+ genport(port).should == "telnet\t23/tcp\n"
+ end
+
+ it "should be able to generate an entry with one alias" do
+ port = mkport(
+ :name => 'pcx-pin',
+ :protocol => :tcp,
+ :number => '4005',
+ :port_aliases => 'pcx-pin',
+ :ensure => :present
+ )
+ genport(port).should == "pcx-pin\t4005/tcp\tpcx-pin\n"
+ end
+
+ it "should be able to generate an entry with more than one alias" do
+ port = mkport(
+ :name => 'pcx-splr-ft',
+ :protocol => :udp,
+ :number => '4003',
+ :port_aliases => [ 'pcx-splr-ft', 'rquotad' ],
+ :ensure => :present
+ )
+ genport(port).should == "pcx-splr-ft\t4003/udp\tpcx-splr-ft rquotad\n"
+ end
+
+ it "should be able to generate a simple hostfile entry with comments" do
+ port = mkport(
+ :name => 'telnet',
+ :protocol => :tcp,
+ :number => '23',
+ :description => 'Fancy # comment',
+ :ensure => :present
+ )
+ genport(port).should == "telnet\t23/tcp\t# Fancy # comment\n"
+ end
+
+ it "should be able to generate an entry with one alias and a comment" do
+ port = mkport(
+ :name => 'foo',
+ :protocol => :tcp,
+ :number => '1',
+ :port_aliases => 'bar',
+ :description => 'Bazinga!',
+ :ensure => :present
+ )
+ genport(port).should == "foo\t1/tcp\tbar\t# Bazinga!\n"
+ end
+
+ it "should be able to generate an entry with more than one alias and a comment" do
+ port = mkport(
+ :name => 'foo',
+ :protocol => :udp,
+ :number => '3000',
+ :port_aliases => [ 'bar', 'baz', 'zap' ],
+ :description => 'Bazinga!',
+ :ensure => :present
+ )
+ genport(port).should == "foo\t3000/udp\tbar baz zap\t# Bazinga!\n"
+ end
+
+end
diff --git a/test/data/providers/port/parsed/nonuniq b/test/data/providers/port/parsed/nonuniq
new file mode 100644
index 0000000..e4eb25a
--- /dev/null
+++ b/test/data/providers/port/parsed/nonuniq
@@ -0,0 +1,6 @@
+# We test a few comments here
+# and anotherone
+telnet 23/tcp # Telnet
+telnets 992/tcp # telnet protocol over TLS/SSL
+telnets 992/ud
+telnet 23/udp
diff --git a/test/data/providers/port/parsed/realworld_linux b/test/data/providers/port/parsed/realworld_linux
new file mode 100644
index 0000000..f7fd67d
--- /dev/null
+++ b/test/data/providers/port/parsed/realworld_linux
@@ -0,0 +1,1179 @@
+# /etc/services
+#
+# Network services, Internet style
+#
+# Note that it is presently the policy of IANA to assign a single well-known
+# port number for both TCP and UDP; hence, most entries here have two entries
+# even if the protocol doesn't support UDP operations.
+#
+# Some References:
+# http://www.iana.org/assignments/port-numbers
+# http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/services
+#
+# Each line describes one service, and is of the form:
+# service-name port/protocol [aliases ...] [# comment]
+#
+# See services(5) for more info.
+#
+
+#
+# IANA Assignments [Well Known Ports]
+# The Well Known Ports are assigned by the IANA and on most systems can
+# only be used by system (or root) processes or by programs executed by
+# privileged users.
+# The range for assigned ports managed by the IANA is 0-1023.
+#
+tcpmux 1/tcp # TCP port service multiplexer
+tcpmux 1/udp
+compressnet 2/tcp # Management Utility
+compressnet 2/udp
+compressnet 3/tcp # Compression Process
+compressnet 3/udp
+rje 5/tcp # Remote Job Entry
+rje 5/udp
+echo 7/tcp # Echo
+echo 7/udp
+discard 9/tcp sink null # Discard
+discard 9/udp sink null
+systat 11/tcp users # Active Users
+systat 11/udp users
+daytime 13/tcp # Daytime (RFC 867)
+daytime 13/udp
+#netstat 15/tcp # (was once asssigned, no more)
+qotd 17/tcp quote # Quote of the Day
+qotd 17/udp quote
+msp 18/tcp # Message Send Protocol
+msp 18/udp
+chargen 19/tcp ttytst source # Character Generator
+chargen 19/udp ttytst source
+ftp-data 20/tcp # File Transfer [Default Data]
+ftp-data 20/udp
+ftp 21/tcp # File Transfer [Control]
+ftp 21/udp fsp fspd
+ssh 22/tcp # SSH Remote Login Protocol
+ssh 22/udp
+telnet 23/tcp # Telnet
+telnet 23/udp
+# private 24/tcp # any private mail system
+# private 24/udp
+smtp 25/tcp mail # Simple Mail Transfer
+smtp 25/udp
+nsw-fe 27/tcp # NSW User System FE
+nsw-fe 27/udp
+msg-icp 29/tcp # MSG ICP
+msg-icp 29/udp
+msg-auth 31/tcp # MSG Authentication
+msg-auth 31/udp
+dsp 33/tcp # Display Support Protocol
+dsp 33/udp
+# private 35/tcp # any private printer server
+# private 35/udp
+time 37/tcp timserver
+time 37/udp timserver
+rap 38/tcp # Route Access Protocol
+rap 38/udp
+rlp 39/tcp resource # Resource Location Protocol
+rlp 39/udp resource
+graphics 41/tcp # Graphics
+graphics 41/udp
+nameserver 42/tcp name # Host Name Server
+nameserver 42/udp name
+nicname 43/tcp whois # Who Is
+nicname 43/udp whois
+mpm-flags 44/tcp # MPM FLAGS Protocol
+mpm-flags 44/udp
+mpm 45/tcp # Message Processing Module [recv]
+mpm 45/udp
+mpm-snd 46/tcp # MPM [default send]
+mpm-snd 46/udp
+ni-ftp 47/tcp # NI FTP
+ni-ftp 47/udp
+auditd 48/tcp # Digital Audit Daemon
+auditd 48/udp
+tacacs 49/tcp # Login Host Protocol (TACACS)
+tacacs 49/udp
+re-mail-ck 50/tcp # Remote Mail Checking Protocol
+re-mail-ck 50/udp
+domain 53/tcp # Domain Name Server
+domain 53/udp
+xns-ch 54/tcp # XNS Clearinghouse
+xns-ch 54/udp
+isi-gl 55/tcp # ISI Graphics Language
+isi-gl 55/udp
+xns-auth 56/tcp # XNS Authentication
+xns-auth 56/udp
+# private 57/tcp # any private terminal access
+# private 57/udp
+xns-mail 58/tcp # XNS Mail
+xns-mail 58/udp
+# private 59/tcp # any private file service
+# private 59/udp
+ni-mail 61/tcp # NI MAIL
+ni-mail 61/udp
+acas 62/tcp # ACA Services
+acas 62/udp
+whois++ 63/tcp # whois++
+whois++ 63/udp
+covia 64/tcp # Communications Integrator (CI)
+covia 64/udp
+tacacs-ds 65/tcp # TACACS-Database Service
+tacacs-ds 65/udp
+sql*net 66/tcp # Oracle SQL*NET
+sql*net 66/udp
+bootps 67/tcp # Bootstrap Protocol Server (BOOTP)
+bootps 67/udp
+bootpc 68/tcp # Bootstrap Protocol Client (BOOTP)
+bootpc 68/udp
+tftp 69/tcp # Trivial File Transfer
+tftp 69/udp
+gopher 70/tcp # Gopher
+gopher 70/udp
+netrjs-1 71/tcp # Remote Job Service
+netrjs-1 71/udp
+netrjs-2 72/tcp
+netrjs-2 72/udp
+netrjs-3 73/tcp
+netrjs-3 73/udp
+netrjs-4 74/tcp
+netrjs-4 74/udp
+# private 75/tcp # any private dial out service
+# private 75/udp
+deos 76/tcp # Distributed External Object Store
+deos 76/udp
+# private 77/tcp # any private RJE service
+# private 77/udp
+vettcp 78/tcp # vettcp
+vettcp 78/udp
+finger 79/tcp # Finger
+finger 79/udp
+http 80/tcp www www-http # World Wide Web HTTP
+http 80/udp www www-http
+hosts2-ns 81/tcp # HOSTS2 Name Server
+hosts2-ns 81/udp
+xfer 82/tcp # XFER Utility
+xfer 82/udp
+mit-ml-dev 83/tcp # MIT ML Device
+mit-ml-dev 83/udp
+ctf 84/tcp # Common Trace Facility
+ctf 84/udp
+mit-ml-dev 85/tcp # MIT ML Device
+mit-ml-dev 85/udp
+mfcobol 86/tcp # Micro Focus Cobol
+mfcobol 86/udp
+# private 87/tcp # any private terminal link
+# private 87/udp
+kerberos 88/tcp kerberos5 krb5 # Kerberos
+kerberos 88/udp kerberos5 krb5
+su-mit-tg 89/tcp # SU/MIT Telnet Gateway
+su-mit-tg 89/udp
+dnsix 90/tcp # DNSIX Securit Attribute Token Map
+dnsix 90/udp
+mit-dov 91/tcp # MIT Dover Spooler
+mit-dov 91/udp
+npp 92/tcp # Network Printing Protocol
+npp 92/udp
+dcp 93/tcp # Device Control Protocol
+dcp 93/udp
+objcall 94/tcp # Tivoli Object Dispatcher
+objcall 94/udp
+supdup 95/tcp # SUPDUP
+supdup 95/udp
+dixie 96/tcp # DIXIE Protocol Specification
+dixie 96/udp
+swift-rvf 97/tcp # Swift Remote Virtural File Protocol
+swift-rvf 97/udp
+tacnews 98/tcp linuxconf # TAC News
+tacnews 98/udp
+metagram 99/tcp # Metagram Relay
+metagram 99/udp
+#newacct 100/tcp # [unauthorized use]
+hostname 101/tcp hostnames # NIC Host Name Server
+hostname 101/udp hostnames
+iso-tsap 102/tcp tsap # ISO-TSAP Class 0
+iso-tsap 102/udp tsap
+gppitnp 103/tcp # Genesis Point-to-Point Trans Net
+gppitnp 103/udp
+acr-nema 104/tcp # ACR-NEMA Digital Imag. & Comm. 300
+acr-nema 104/udp
+cso 105/tcp csnet-ns cso-ns # CCSO name server protocol
+cso 105/udp csnet-ns cso-ns
+3com-tsmux 106/tcp poppassd # 3COM-TSMUX
+3com-tsmux 106/udp poppassd # Eudora: Unauthorized use by insecure poppassd protocol
+rtelnet 107/tcp # Remote Telnet Service
+rtelnet 107/udp
+snagas 108/tcp # SNA Gateway Access Server
+snagas 108/udp
+pop2 109/tcp pop-2 postoffice # Post Office Protocol - Version 2
+pop2 109/udp pop-2
+pop3 110/tcp pop-3 # Post Office Protocol - Version 3
+pop3 110/udp pop-3
+sunrpc 111/tcp portmapper rpcbind # SUN Remote Procedure Call
+sunrpc 111/udp portmapper rpcbind
+mcidas 112/tcp # McIDAS Data Transmission Protocol
+mcidas 112/udp
+auth 113/tcp authentication tap ident # Authentication Service
+auth 113/udp
+sftp 115/tcp # Simple File Transfer Protocol
+sftp 115/udp
+ansanotify 116/tcp # ANSA REX Notify
+ansanotify 116/udp
+uucp-path 117/tcp # UUCP Path Service
+uucp-path 117/udp
+sqlserv 118/tcp # SQL Services
+sqlserv 118/udp
+nntp 119/tcp readnews untp # Network News Transfer Protocol
+nntp 119/udp readnews untp
+cfdptkt 120/tcp # CFDPTKT
+cfdptkt 120/udp
+erpc 121/tcp # Encore Expedited Remote Pro.Call
+erpc 121/udp
+smakynet 122/tcp # SMAKYNET
+smakynet 122/udp
+ntp 123/tcp # Network Time Protocol
+ntp 123/udp
+ansatrader 124/tcp # ANSA REX Trader
+ansatrader 124/udp
+locus-map 125/tcp # Locus PC-Interface Net Map Ser
+locus-map 125/udp
+nxedit 126/tcp unitary # NXEdit
+nxedit 126/udp unitary # Unisys Unitary Login
+locus-con 127/tcp # Locus PC-Interface Conn Server
+locus-con 127/udp
+gss-xlicen 128/tcp # GSS X License Verification
+gss-xlicen 128/udp
+pwdgen 129/tcp # Password Generator Protocol
+pwdgen 129/udp
+cisco-fna 130/tcp # cisco FNATIVE
+cisco-fna 130/udp
+cisco-tna 131/tcp # cisco TNATIVE
+cisco-tna 131/udp
+cisco-sys 132/tcp # cisco SYSMAINT
+cisco-sys 132/udp
+statsrv 133/tcp # Statistics Service
+statsrv 133/udp
+ingres-net 134/tcp # INGRES-NET Service
+ingres-net 134/udp
+epmap 135/tcp loc-srv # DCE endpoint resolution
+epmap 135/udp loc-srv
+profile 136/tcp # PROFILE Naming System
+profile 136/udp
+netbios-ns 137/tcp # NETBIOS Name Service
+netbios-ns 137/udp
+netbios-dgm 138/tcp # NETBIOS Datagram Service
+netbios-dgm 138/udp
+netbios-ssn 139/tcp # NETBIOS Session Service
+netbios-ssn 139/udp
+emfis-data 140/tcp # EMFIS Data Service
+emfis-data 140/udp
+emfis-cntl 141/tcp # EMFIS Control Service
+emfis-cntl 141/udp
+imap 143/tcp imap2 # Internet Message Access Protocol
+imap 143/udp imap2
+uma 144/tcp # Universal Management Architecture
+uma 144/udp
+uaac 145/tcp # UAAC Protocol
+uaac 145/udp
+iso-tp0 146/tcp # ISO-TP0
+iso-tp0 146/udp
+iso-ip 147/tcp # ISO-IP
+iso-ip 147/udp
+jargon 148/tcp # Jargon
+jargon 148/udp
+aed-512 149/tcp # AED 512 Emulation Service
+aed-512 149/udp
+sql-net 150/tcp # SQL-NET
+sql-net 150/udp
+hems 151/tcp # HEMS
+hems 151/udp
+bftp 152/tcp # Background File Transfer Program
+bftp 152/udp
+sgmp 153/tcp # SGMP
+sgmp 153/udp
+netsc-prod 154/tcp # NETSC
+netsc-prod 154/udp
+netsc-dev 155/tcp
+netsc-dev 155/udp
+sqlsrv 156/tcp # SQL Service
+sqlsrv 156/udp
+knet-cmp 157/tcp # KNET/VM Command/Message Protocol
+knet-cmp 157/udp
+pcmail-srv 158/tcp # PCMail Server
+pcmail-srv 158/udp
+nss-routing 159/tcp # NSS-Routing
+nss-routing 159/udp
+sgmp-traps 160/tcp # SGMP-TRAPS
+sgmp-traps 160/udp
+snmp 161/tcp # Simple Net Mgmt Proto
+snmp 161/udp
+snmptrap 162/tcp snmp-trap # Traps for SNMP
+snmptrap 162/udp snmp-trap
+cmip-man 163/tcp # CMIP/TCP Manager
+cmip-man 163/udp
+cmip-agent 164/tcp # CMIP/TCP Agent
+cmip-agent 164/udp
+xns-courier 165/tcp # Xerox
+xns-courier 165/udp
+s-net 166/tcp # Sirius Systems
+s-net 166/udp
+namp 167/tcp # NAMP
+namp 167/udp
+rsvd 168/tcp # RSVD
+rsvd 168/udp
+send 169/tcp # SEND
+send 169/udp
+print-srv 170/tcp # Network PostScript
+print-srv 170/udp
+multiplex 171/tcp # Network Innovations Multiplex
+multiplex 171/udp
+cl/1 172/tcp # Network Innovations CL/1
+cl/1 172/udp
+xyplex-mux 173/tcp # Xyplex
+xyplex-mux 173/udp
+mailq 174/tcp # Mailer transport queue for Zmailer
+mailq 174/udp
+vmnet 175/tcp # VMNET
+vmnet 175/udp
+genrad-mux 176/tcp # GENRAD-MUX
+genrad-mux 176/udp
+xdmcp 177/tcp # X Display Manager Control Protocol
+xdmcp 177/udp
+nextstep 178/tcp NeXTStep NextStep # NextStep Window Server
+nextstep 178/udp NeXTStep NextStep
+bgp 179/tcp # Border Gateway Protocol
+bgp 179/udp
+ris 180/tcp # Intergraph
+ris 180/udp
+unify 181/tcp # Unify
+unify 181/udp
+audit 182/tcp # Unisys Audit SITP
+audit 182/udp
+ocbinder 183/tcp # OCBinder
+ocbinder 183/udp
+ocserver 184/tcp # OCServer
+ocserver 184/udp
+remote-kis 185/tcp # Remote-KIS
+remote-kis 185/udp
+kis 186/tcp # KIS Protocol
+kis 186/udp
+aci 187/tcp # Application Communication Interface
+aci 187/udp
+mumps 188/tcp # Plus Five's MUMPS
+mumps 188/udp
+qft 189/tcp # Queued File Transport
+qft 189/udp
+gacp 190/tcp # Gateway Access Control Protocol
+gacp 190/udp
+prospero 191/tcp # Prospero Directory Service
+prospero 191/udp
+osu-nms 192/tcp # OSU Network Monitoring System
+osu-nms 192/udp
+srmp 193/tcp # Spider Remote Monitoring Protocol
+srmp 193/udp
+irc 194/tcp # Internet Relay Chat Protocol
+irc 194/udp
+dn6-nlm-aud 195/tcp # DNSIX Network Level Module Audit
+dn6-nlm-aud 195/udp
+dn6-smm-red 196/tcp # DNSIX Session Mgt Module Audit Redir
+dn6-smm-red 196/udp
+dls 197/tcp # Directory Location Service
+dls 197/udp
+dls-mon 198/tcp # Directory Location Service Monitor
+dls-mon 198/udp
+smux 199/tcp # SNMP Unix Multiplexer
+smux 199/udp
+src 200/tcp # IBM System Resource Controller
+src 200/udp
+at-rtmp 201/tcp # AppleTalk Routing Maintenance
+at-rtmp 201/udp
+at-nbp 202/tcp # AppleTalk Name Binding
+at-nbp 202/udp
+at-echo 204/tcp # AppleTalk Echo
+at-echo 204/udp
+at-zis 206/tcp # AppleTalk Zone Information
+at-zis 206/udp
+qmtp 209/tcp # The Quick Mail Transfer Protocol
+qmtp 209/udp
+z39.50 210/tcp wais z3950 # ANSI Z39.50
+z39.50 210/udp wais z3950
+914c/g 211/tcp # Texas Instruments 914C/G Terminal
+914c/g 211/udp
+anet 212/tcp # ATEXSSTR
+anet 212/udp
+ipx 213/tcp # IPX
+ipx 213/udp
+imap3 220/tcp # Interactive Mail Access
+imap3 220/udp
+link 245/tcp # ttylink
+link 245/udp
+pawserv 345/tcp # Perf Analysis Workbench
+pawserv 345/udp
+zserv 346/tcp # Zebra server
+zserv 346/udp
+fatserv 347/tcp # Fatmen Server
+fatserv 347/udp
+scoi2odialog 360/tcp # scoi2odialog
+scoi2odialog 360/udp
+semantix 361/tcp # Semantix
+semantix 361/udp
+srssend 362/tcp # SRS Send
+srssend 362/udp
+rsvp_tunnel 363/tcp # RSVP Tunnel
+rsvp_tunnel 363/udp
+aurora-cmgr 364/tcp # Aurora CMGR
+aurora-cmgr 364/udp
+dtk 365/tcp # Deception Tool Kit
+dtk 365/udp
+odmr 366/tcp # ODMR
+odmr 366/udp
+rpc2portmap 369/tcp # Coda portmapper
+rpc2portmap 369/udp
+codaauth2 370/tcp # Coda authentication server
+codaauth2 370/udp
+clearcase 371/tcp # Clearcase
+clearcase 371/udp
+ulistproc 372/tcp ulistserv # UNIX Listserv
+ulistproc 372/udp ulistserv
+ldap 389/tcp # Lightweight Directory Access Protocol
+ldap 389/udp
+imsp 406/tcp # Interactive Mail Support Protocol
+imsp 406/udp
+svrloc 427/tcp # Server Location
+svrloc 427/udp
+mobileip-agent 434/tcp # MobileIP-Agent
+mobileip-agent 434/udp
+mobilip-mn 435/tcp # MobilIP-MN
+mobilip-mn 435/udp
+https 443/tcp # MCom
+https 443/udp
+snpp 444/tcp # Simple Network Paging Protocol
+snpp 444/udp
+microsoft-ds 445/tcp Microsoft-DS
+microsoft-ds 445/udp Microsoft-DS
+kpasswd 464/tcp kpwd # Kerberos "passwd"
+kpasswd 464/udp kpwd
+urd 465/tcp smtps ssmtp # URL Rendesvous Directory for SSM / smtp protocol over TLS/SSL
+igmpv3lite 465/udp smtps ssmtp # IGMP over UDP for SSM
+photuris 468/tcp
+photuris 468/udp
+rcp 469/tcp # Radio Control Protocol
+rcp 469/udp
+saft 487/tcp # Simple Asynchronous File Transfer
+saft 487/udp
+gss-http 488/tcp
+gss-http 488/udp
+pim-rp-disc 496/tcp
+pim-rp-disc 496/udp
+isakmp 500/tcp # IPsec - Internet Security Association and Key Management Protocol
+isakmp 500/udp
+exec 512/tcp # remote process execution
+comsat 512/udp biff # notify users of new mail received
+login 513/tcp # remote login a la telnet
+who 513/udp whod # who's logged in to machines
+shell 514/tcp cmd # no passwords used
+syslog 514/udp
+printer 515/tcp spooler # line printer spooler
+printer 515/udp spooler
+videotex 516/tcp
+videotex 516/udp
+talk 517/tcp # like tenex link
+talk 517/udp
+ntalk 518/tcp
+ntalk 518/udp
+utime 519/tcp unixtime
+utime 519/udp unixtime
+efs 520/tcp # extended file name server
+router 520/udp route routed # local routing process
+ripng 521/tcp
+ripng 521/udp
+ulp 522/tcp
+ulp 522/udp
+ibm-db2 523/tcp
+ibm-db2 523/udp
+ncp 524/tcp
+ncp 524/udp
+timed 525/tcp timeserver
+timed 525/udp timeserver
+tempo 526/tcp newdate
+tempo 526/udp newdate
+courier 530/tcp rpc
+courier 530/udp rpc
+conference 531/tcp chat
+conference 531/udp chat
+netnews 532/tcp readnews
+netnews 532/udp readnews
+netwall 533/tcp # -for emergency broadcasts
+netwall 533/udp
+mm-admin 534/tcp # MegaMedia Admin
+mm-admin 534/udp
+iiop 535/tcp
+iiop 535/udp
+opalis-rdv 536/tcp
+opalis-rdv 536/udp
+nmsp 537/tcp # Networked Media Streaming Protocol
+nmsp 537/udp
+gdomap 538/tcp # GNUstep distributed objects
+gdomap 538/udp
+uucp 540/tcp uucpd # uucp daemon
+uucp 540/udp uucpd
+klogin 543/tcp # Kerberized `rlogin' (v5)
+klogin 543/udp
+kshell 544/tcp krcmd # Kerberized `rsh' (v5)
+kshell 544/udp krcmd
+appleqtcsrvr 545/tcp
+appleqtcsrvr 545/udp
+dhcpv6-client 546/tcp # DHCPv6 Client
+dhcpv6-client 546/udp
+dhcpv6-server 547/tcp # DHCPv6 Server
+dhcpv6-server 547/udp
+afpovertcp 548/tcp # AFP over TCP
+afpovertcp 548/udp
+rtsp 554/tcp # Real Time Stream Control Protocol
+rtsp 554/udp
+dsf 555/tcp
+dsf 555/udp
+remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem
+remotefs 556/udp rfs_server rfs
+nntps 563/tcp snntp # NNTP over SSL
+nntps 563/udp snntp
+9pfs 564/tcp # plan 9 file service
+9pfs 564/udp
+whoami 565/tcp
+whoami 565/udp
+submission 587/tcp # mail message submission
+submission 587/udp
+http-alt 591/tcp # FileMaker, Inc. - HTTP Alternate
+http-alt 591/udp
+nqs 607/tcp # Network Queuing system
+nqs 607/udp
+npmp-local 610/tcp dqs313_qmaster # npmp-local / DQS
+npmp-local 610/udp dqs313_qmaster
+npmp-gui 611/tcp dqs313_execd # npmp-gui / DQS
+npmp-gui 611/udp dqs313_execd
+hmmp-ind 612/tcp dqs313_intercell # HMMP Indication / DQS
+hmmp-ind 612/udp dqs313_intercell
+cryptoadmin 624/tcp # Crypto Admin
+cryptoadmin 624/udp
+dec_dlm 625/tcp # DEC DLM
+dec_dlm 625/udp
+asia 626/tcp
+asia 626/udp
+passgo-tivoli 627/tcp # PassGo Tivoli
+passgo-tivoli 627/udp
+qmqp 628/tcp # Qmail QMQP
+qmqp 628/udp
+3com-amp3 629/tcp
+3com-amp3 629/udp
+rda 630/tcp
+rda 630/udp
+ipp 631/tcp # Internet Printing Protocol
+ipp 631/udp
+ldaps 636/tcp # LDAP over SSL
+ldaps 636/udp
+tinc 655/tcp # TINC control port
+tinc 655/udp
+acap 674/tcp # Application Configuration Access Protocol
+acap 674/udp
+asipregistry 687/tcp
+asipregistry 687/udp
+realm-rusd 688/tcp # ApplianceWare managment protocol
+realm-rusd 688/udp
+nmap 689/tcp # Opensource Network Mapper
+nmap 689/udp
+ha-cluster 694/tcp # Heartbeat HA-cluster
+ha-cluster 694/udp
+epp 700/tcp # Extensible Provisioning Protocol
+epp 700/udp
+iris-beep 702/tcp # IRIS over BEEP
+iris-beep 702/udp
+silc 706/tcp # SILC
+silc 706/udp
+kerberos-adm 749/tcp # Kerberos `kadmin' (v5)
+kerberos-adm 749/udp
+kerberos-iv 750/tcp kerberos4 kdc # Kerberos (server)
+kerberos-iv 750/udp kerberos4 kdc
+pump 751/tcp kerberos_master
+pump 751/udp kerberos_master # Kerberos authentication
+qrh 752/tcp passwd_server
+qrh 752/udp passwd_server # Kerberos passwd server
+rrh 753/tcp
+rrh 753/udp
+tell 754/tcp send krb_prop krb5_prop # Kerberos slave propagation
+tell 754/udp send
+nlogin 758/tcp
+nlogin 758/udp
+con 759/tcp
+con 759/udp
+ns 760/tcp krbupdate kreg # Kerberos registration
+ns 760/udp
+webster 765/tcp # Network dictionary
+webster 765/udp
+phonebook 767/tcp # Network phonebook
+phonebook 767/udp
+rsync 873/tcp # rsync
+rsync 873/udp
+ftps-data 989/tcp # ftp protocol, data, over TLS/SSL
+ftps-data 989/udp
+ftps 990/tcp # ftp protocol, control, over TLS/SSL
+ftps 990/udp
+nas 991/tcp # Netnews Administration System
+nas 991/udp
+telnets 992/tcp # telnet protocol over TLS/SSL
+telnets 992/udp
+imaps 993/tcp # imap4 protocol over TLS/SSL
+imaps 993/udp
+ircs 994/tcp # irc protocol over TLS/SSL
+ircs 994/udp
+pop3s 995/tcp # pop3 protocol over TLS/SSL
+pop3s 995/udp
+
+#
+# IANA Assignments [Registered Ports]
+#
+# The Registered Ports are listed by the IANA and on most systems can be
+# used by ordinary user processes or programs executed by ordinary
+# users.
+# Ports are used in the TCP [RFC793] to name the ends of logical
+# connections which carry long term conversations. For the purpose of
+# providing services to unknown callers, a service contact port is
+# defined. This list specifies the port used by the server process as
+# its contact port.
+# The IANA registers uses of these ports as a convenience to the
+# community.
+# To the extent possible, these same port assignments are used with the
+# UDP [RFC768].
+# The Registered Ports are in the range 1024-49151.
+#
+imgames 1077/tcp
+imgames 1077/udp
+socks 1080/tcp # socks proxy server
+socks 1080/udp
+rmiregistry 1099/tcp # Java RMI Registry
+rmiregistry 1099/udp
+bnetgame 1119/tcp # Battle.net Chat/Game Protocol
+bnetgame 1119/udp
+bnetfile 1120/tcp # Battle.net File Transfer Protocol
+bnetfile 1120/udp
+hpvmmcontrol 1124/tcp # HP VMM Control
+hpvmmcontrol 1124/udp
+hpvmmagent 1125/tcp # HP VMM Agent
+hpvmmagent 1125/udp
+hpvmmdata 1126/tcp # HP VMM Agent
+hpvmmdata 1126/udp
+resacommunity 1154/tcp # Community Service
+resacommunity 1154/udp
+3comnetman 1181/tcp # 3Com Net Management
+3comnetman 1181/udp
+mysql-cluster 1186/tcp # MySQL Cluster Manager
+mysql-cluster 1186/udp
+alias 1187/tcp # Alias Service
+alias 1187/udp
+openvpn 1194/tcp # OpenVPN
+openvpn 1194/udp
+kazaa 1214/tcp # KAZAA
+kazaa 1214/udp
+bvcontrol 1236/tcp rmtcfg # Gracilis Packeten remote config server
+bvcontrol 1236/udp rmtcfg
+nessus 1241/tcp # Nessus vulnerability assessment scanner
+nessus 1241/udp
+h323hostcallsc 1300/tcp # H323 Host Call Secure
+h323hostcallsc 1300/udp
+lotusnote 1352/tcp # Lotus Note
+lotusnote 1352/udp
+ms-sql-s 1433/tcp # Microsoft-SQL-Server
+ms-sql-s 1433/udp
+ms-sql-m 1434/tcp # Microsoft-SQL-Monitor
+ms-sql-m 1434/udp
+ica 1494/tcp # Citrix ICA Client
+ica 1494/udp
+wins 1512/tcp # Microsoft's Windows Internet Name Service
+wins 1512/udp
+ingreslock 1524/tcp
+ingreslock 1524/udp
+prospero-np 1525/tcp # Prospero non-privileged
+prospero-np 1525/udp
+datametrics 1645/tcp old-radius # datametrics / old radius entry
+datametrics 1645/udp old-radius
+sa-msg-port 1646/tcp old-radacct # sa-msg-port / old radacct entry
+sa-msg-port 1646/udp old-radacct
+rsap 1647/tcp
+rsap 1647/udp
+concurrent-lm 1648/tcp
+concurrent-lm 1648/udp
+kermit 1649/tcp
+kermit 1649/udp
+l2tp 1701/tcp
+l2tp 1701/udp
+h323gatedisc 1718/tcp
+h323gatedisc 1718/udp
+h323gatestat 1719/tcp
+h323gatestat 1719/udp
+h323hostcall 1720/tcp
+h323hostcall 1720/udp
+iberiagames 1726/tcp
+iberiagames 1726/udp
+gamegen1 1738/tcp
+gamegen1 1738/udp
+tftp-mcast 1758/tcp
+tftp-mcast 1758/udp
+hello 1789/tcp
+hello 1789/udp
+radius 1812/tcp # Radius
+radius 1812/udp
+radius-acct 1813/tcp radacct # Radius Accounting
+radius-acct 1813/udp radacct
+mtp 1911/tcp # Starlight Networks Multimedia Transport Protocol
+mtp 1911/udp
+egs 1926/tcp # Evolution Game Server
+egs 1926/udp
+unix-status 1957/tcp # remstats unix-status server
+unix-status 1957/udp
+hsrp 1985/tcp # Hot Standby Router Protocol
+hsrp 1985/udp
+licensedaemon 1986/tcp # cisco license management
+licensedaemon 1986/udp
+tr-rsrb-p1 1987/tcp # cisco RSRB Priority 1 port
+tr-rsrb-p1 1987/udp
+tr-rsrb-p2 1988/tcp # cisco RSRB Priority 2 port
+tr-rsrb-p2 1988/udp
+tr-rsrb-p3 1989/tcp # cisco RSRB Priority 3 port
+tr-rsrb-p3 1989/udp
+stun-p1 1990/tcp # cisco STUN Priority 1 port
+stun-p1 1990/udp
+stun-p2 1991/tcp # cisco STUN Priority 2 port
+stun-p2 1991/udp
+stun-p3 1992/tcp # cisco STUN Priority 3 port
+stun-p3 1992/udp
+snmp-tcp-port 1994/tcp # cisco SNMP TCP port
+snmp-tcp-port 1994/udp
+stun-port 1995/tcp # cisco serial tunnel port
+stun-port 1995/udp
+perf-port 1996/tcp # cisco Remote SRB port
+perf-port 1996/udp
+gdp-port 1997/tcp # cisco Gateway Discovery Protocol
+gdp-port 1997/udp
+x25-svc-port 1998/tcp # cisco X.25 service (XOT)
+x25-svc-port 1998/udp
+tcp-id-port 1999/tcp # cisco identification port
+tcp-id-port 1999/udp
+cisco-sccp 2000/tcp sieve # Cisco SCCP
+cisco-sccp 2000/udp sieve
+nfs 2049/tcp # Network File System
+nfs 2049/udp
+radsec 2083/tcp # Secure Radius Service
+radsec 2083/udp
+gnunet 2086/tcp # GNUnet
+gnunet 2086/udp
+rtcm-sc104 2101/tcp # RTCM SC-104
+rtcm-sc104 2101/udp
+zephyr-srv 2102/tcp # Zephyr server
+zephyr-srv 2102/udp
+zephyr-clt 2103/tcp # Zephyr serv-hm connection
+zephyr-clt 2103/udp
+zephyr-hm 2104/tcp # Zephyr hostmanager
+zephyr-hm 2104/udp
+eyetv 2170/tcp # EyeTV Server Port
+eyetv 2170/udp
+msfw-storage 2171/tcp # MS Firewall Storage
+msfw-storage 2171/udp
+msfw-s-storage 2172/tcp # MS Firewall SecureStorage
+msfw-s-storage 2172/udp
+msfw-replica 2173/tcp # MS Firewall Replication
+msfw-replica 2173/udp
+msfw-array 2174/tcp # MS Firewall Intra Array
+msfw-array 2174/udp
+airsync 2175/tcp # Microsoft Desktop AirSync Protocol
+airsync 2175/udp
+rapi 2176/tcp # Microsoft ActiveSync Remote API
+rapi 2176/udp
+qwave 2177/tcp # qWAVE Bandwidth Estimate
+qwave 2177/udp
+tivoconnect 2190/tcp # TiVoConnect Beacon
+tivoconnect 2190/udp
+tvbus 2191/tcp # TvBus Messaging
+tvbus 2191/udp
+mysql-im 2273/tcp # MySQL Instance Manager
+mysql-im 2273/udp
+dict-lookup 2289/tcp # Lookup dict server
+dict-lookup 2289/udp
+redstorm_join 2346/tcp # Game Connection Port
+redstorm_join 2346/udp
+redstorm_find 2347/tcp # Game Announcement and Location
+redstorm_find 2347/udp
+redstorm_info 2348/tcp # Information to query for game status
+redstorm_info 2348/udp
+cvspserver 2401/tcp # CVS client/server operations
+cvspserver 2401/udp
+venus 2430/tcp # codacon port
+venus 2430/udp
+venus-se 2431/tcp # tcp side effects
+venus-se 2431/udp
+codasrv 2432/tcp # not used
+codasrv 2432/udp
+codasrv-se 2433/tcp # tcp side effects
+codasrv-se 2433/udp
+netadmin 2450/tcp
+netadmin 2450/udp
+netchat 2451/tcp
+netchat 2451/udp
+snifferclient 2452/tcp
+snifferclient 2452/udp
+ppcontrol 2505/tcp # PowerPlay Control
+ppcontrol 2505/udp
+lstp 2559/tcp
+lstp 2559/udp
+mon 2583/tcp
+mon 2583/udp
+hpstgmgr 2600/tcp zebrasrv
+hpstgmgr 2600/udp zebrasrv
+discp-client 2601/tcp zebra # discp client
+discp-client 2601/udp zebra
+discp-server 2602/tcp ripd # discp server
+discp-server 2602/udp ripd
+servicemeter 2603/tcp ripngd # Service Meter
+servicemeter 2603/udp ripngd
+nsc-ccs 2604/tcp ospfd # NSC CCS
+nsc-ccs 2604/udp ospfd
+nsc-posa 2605/tcp bgpd # NSC POSA
+nsc-posa 2605/udp bgpd
+netmon 2606/tcp ospf6d # Dell Netmon
+netmon 2606/udp ospf6d
+connection 2607/tcp # Dell Connection
+connection 2607/udp
+wag-service 2608/tcp # Wag Service
+wag-service 2608/udp
+dict 2628/tcp # Dictionary server
+dict 2628/udp
+exce 2769/tcp # eXcE
+exce 2769/udp
+dvr-esm 2804/tcp # March Networks Digital Video Recorders and Enterprise Service Manager products
+dvr-esm 2804/udp
+corbaloc 2809/tcp # CORBA LOC
+corbaloc 2809/udp
+ndtp 2882/tcp # Network Dictionary Transfer Protocol
+ndtp 2882/udp
+gamelobby 2914/tcp # Game Lobby
+gamelobby 2914/udp
+gds_db 3050/tcp # InterBase server
+gds_db 3050/udp
+xbox 3074/tcp # Xbox game port
+xbox 3074/udp
+icpv2 3130/tcp icp # Internet Cache Protocol (Squid)
+icpv2 3130/udp icp
+nm-game-admin 3148/tcp # NetMike Game Administrator
+nm-game-admin 3148/udp
+nm-game-server 3149/tcp # NetMike Game Server
+nm-game-server 3149/udp
+mysql 3306/tcp # MySQL
+mysql 3306/udp
+sftu 3326/tcp
+sftu 3326/udp
+trnsprntproxy 3346/tcp # Transparent Proxy
+trnsprntproxy 3346/udp
+ms-wbt-server 3389/tcp rdp # MS WBT Server
+ms-wbt-server 3389/udp rdp # Microsoft Remote Desktop Protocol
+prsvp 3455/tcp # RSVP Port
+prsvp 3455/udp
+nut 3493/tcp # Network UPS Tools
+nut 3493/udp
+ironstorm 3504/tcp # IronStorm game server
+ironstorm 3504/udp
+cctv-port 3559/tcp # CCTV control port
+cctv-port 3559/udp
+iw-mmogame 3596/tcp # Illusion Wireless MMOG
+iw-mmogame 3596/udp
+distcc 3632/tcp # Distributed Compiler
+distcc 3632/udp
+daap 3689/tcp # Digital Audio Access Protocol
+daap 3689/udp
+svn 3690/tcp # Subversion
+svn 3690/udp
+blizwow 3724/tcp # World of Warcraft
+blizwow 3724/udp
+netboot-pxe 3928/tcp pxe # PXE NetBoot Manager
+netboot-pxe 3928/udp pxe
+smauth-port 3929/tcp # AMS Port
+smauth-port 3929/udp
+treehopper 3959/tcp # Tree Hopper Networking
+treehopper 3959/udp
+cobraclient 3970/tcp # Cobra Client
+cobraclient 3970/udp
+cobraserver 3971/tcp # Cobra Server
+cobraserver 3971/udp
+pxc-spvr-ft 4002/tcp pxc-spvr-ft
+pxc-spvr-ft 4002/udp pxc-spvr-ft
+pxc-splr-ft 4003/tcp pxc-splr-ft rquotad
+pxc-splr-ft 4003/udp pxc-splr-ft rquotad
+pxc-roid 4004/tcp pxc-roid
+pxc-roid 4004/udp pxc-roid
+pxc-pin 4005/tcp pxc-pin
+pxc-pin 4005/udp pxc-pin
+pxc-spvr 4006/tcp pxc-spvr
+pxc-spvr 4006/udp pxc-spvr
+pxc-splr 4007/tcp pxc-splr
+pxc-splr 4007/udp pxc-splr
+xgrid 4111/tcp # Mac OS X Server Xgrid
+xgrid 4111/udp
+bzr 4155/tcp # Bazaar Version Control System
+bzr 4155/udp # Bazaar version control system
+rwhois 4321/tcp # Remote Who Is
+rwhois 4321/udp
+epmd 4369/tcp # Erlang Port Mapper Daemon
+epmd 4369/udp
+krb524 4444/tcp
+krb524 4444/udp
+ipsec-nat-t 4500/tcp # IPsec NAT-Traversal
+ipsec-nat-t 4500/udp
+hylafax 4559/tcp # HylaFAX client-server protocol (new)
+hylafax 4559/udp
+piranha1 4600/tcp
+piranha1 4600/udp
+playsta2-app 4658/tcp # PlayStation2 App Port
+playsta2-app 4658/udp
+playsta2-lob 4659/tcp # PlayStation2 Lobby Port
+playsta2-lob 4659/udp
+snap 4752/tcp # Simple Network Audio Protocol
+snap 4752/udp
+radmin-port 4899/tcp # RAdmin Port
+radmin-port 4899/udp
+rfe 5002/tcp # Radio Free Ethernet
+rfe 5002/udp
+ita-agent 5051/tcp # ITA Agent
+ita-agent 5051/udp
+sdl-ets 5081/tcp # SDL - Ent Trans Server
+sdl-ets 5081/udp
+bzflag 5154/tcp # BZFlag game server
+bzflag 5154/udp
+aol 5190/tcp # America-Online
+aol 5190/udp
+xmpp-client 5222/tcp # XMPP Client Connection
+xmpp-client 5222/udp
+caevms 5251/tcp # CA eTrust VM Service
+caevms 5251/udp
+xmpp-server 5269/tcp # XMPP Server Connection
+xmpp-server 5269/udp
+cfengine 5308/tcp # CFengine
+cfengine 5308/udp
+nat-pmp 5351/tcp # NAT Port Mapping Protocol
+nat-pmp 5351/udp
+dns-llq 5352/tcp # DNS Long-Lived Queries
+dns-llq 5352/udp
+mdns 5353/tcp # Multicast DNS
+mdns 5353/udp
+mdnsresponder 5354/tcp noclog # Multicast DNS Responder IPC
+mdnsresponder 5354/udp noclog # noclogd with TCP (nocol)
+llmnr 5355/tcp hostmon # Link-Local Multicast Name Resolution
+llmnr 5355/udp hostmon # hostmon uses TCP (nocol)
+dj-ice 5419/tcp
+dj-ice 5419/udp
+beyond-remote 5424/tcp # Beyond Remote
+beyond-remote 5424/udp
+br-channel 5425/tcp # Beyond Remote Command Channel
+br-channel 5425/udp
+postgresql 5432/tcp # POSTGRES
+postgresql 5432/udp
+sgi-eventmond 5553/tcp # SGI Eventmond Port
+sgi-eventmond 5553/udp
+sgi-esphttp 5554/tcp # SGI ESP HTTP
+sgi-esphttp 5554/udp
+cvsup 5999/tcp # CVSup
+cvsup 5999/udp
+x11 6000/tcp # X Window System
+x11 6000/udp
+kftp-data 6620/tcp # Kerberos V5 FTP Data
+kftp-data 6620/udp
+kftp 6621/tcp # Kerberos V5 FTP Control
+kftp 6621/udp
+ktelnet 6623/tcp # Kerberos V5 Telnet
+ktelnet 6623/udp
+gnutella-svc 6346/tcp
+gnutella-svc 6346/udp
+gnutella-rtr 6347/tcp
+gnutella-rtr 6347/udp
+sane-port 6566/tcp # SANE Network Scanner Control Port
+sane-port 6566/udp
+parsec-game 6582/tcp # Parsec Gameserver
+parsec-game 6582/udp
+afs3-fileserver 7000/tcp bbs # file server itself
+afs3-fileserver 7000/udp bbs
+afs3-callback 7001/tcp # callbacks to cache managers
+afs3-callback 7001/udp
+afs3-prserver 7002/tcp # users & groups database
+afs3-prserver 7002/udp
+afs3-vlserver 7003/tcp # volume location database
+afs3-vlserver 7003/udp
+afs3-kaserver 7004/tcp # AFS/Kerberos authentication
+afs3-kaserver 7004/udp
+afs3-volser 7005/tcp # volume managment server
+afs3-volser 7005/udp
+afs3-errors 7006/tcp # error interpretation service
+afs3-errors 7006/udp
+afs3-bos 7007/tcp # basic overseer process
+afs3-bos 7007/udp
+afs3-update 7008/tcp # server-to-server updater
+afs3-update 7008/udp
+afs3-rmtsys 7009/tcp # remote cache manager service
+afs3-rmtsys 7009/udp
+font-service 7100/tcp xfs # X Font Service
+font-service 7100/udp xfs
+sncp 7560/tcp # Sniffer Command Protocol
+sncp 7560/udp
+soap-http 7627/tcp # SOAP Service Port
+soap-http 7627/udp
+http-alt 8008/tcp # HTTP Alternate
+http-alt 8008/udp
+http-alt 8080/tcp webcache # HTTP Alternate
+http-alt 8080/udp webcache # WWW caching service
+sunproxyadmin 8081/tcp tproxy # Sun Proxy Admin Service
+sunproxyadmin 8081/udp tproxy # Transparent Proxy
+pichat 9009/tcp # Pichat Server
+pichat 9009/udp
+bacula-dir 9101/tcp # Bacula Director
+bacula-dir 9101/udp
+bacula-fd 9102/tcp # Bacula File Daemon
+bacula-fd 9102/udp
+bacula-sd 9103/tcp # Bacula Storage Daemon
+bacula-sd 9103/udp
+dddp 9131/tcp # Dynamic Device Discovery
+dddp 9131/udp
+wap-wsp 9200/tcp # WAP connectionless session service
+wap-wsp 9200/udp
+wap-wsp-wtp 9201/tcp # WAP session service
+wap-wsp-wtp 9201/udp
+wap-wsp-s 9202/tcp # WAP secure connectionless session service
+wap-wsp-s 9202/udp
+wap-wsp-wtp-s 9203/tcp # WAP secure session service
+wap-wsp-wtp-s 9203/udp
+wap-vcard 9204/tcp # WAP vCard
+wap-vcard 9204/udp
+wap-vcal 9205/tcp # WAP vCal
+wap-vcal 9205/udp
+wap-vcard-s 9206/tcp # WAP vCard Secure
+wap-vcard-s 9206/udp
+wap-vcal-s 9207/tcp # WAP vCal Secure
+wap-vcal-s 9207/udp
+git 9418/tcp # git pack transfer service
+git 9418/udp
+cba8 9593/tcp # LANDesk Management Agent
+cba8 9593/udp
+davsrc 9800/tcp # WebDav Source Port
+davsrc 9800/udp
+sd 9876/tcp # Session Director
+sd 9876/udp
+cyborg-systems 9888/tcp # CYBORG Systems
+cyborg-systems 9888/udp
+monkeycom 9898/tcp # MonkeyCom
+monkeycom 9898/udp
+sctp-tunneling 9899/tcp # SCTP TUNNELING
+sctp-tunneling 9899/udp
+domaintime 9909/tcp # domaintime
+domaintime 9909/udp
+amanda 10080/tcp # amanda backup services
+amanda 10080/udp
+vce 11111/tcp # Viral Computing Environment (VCE)
+vce 11111/udp
+smsqp 11201/tcp # Alamin SMS gateway
+smsqp 11201/udp
+hkp 11371/tcp # OpenPGP HTTP Keyserver
+hkp 11371/udp
+h323callsigalt 11720/tcp # h323 Call Signal Alternate
+h323callsigalt 11720/udp
+rets-ssl 12109/tcp # RETS over SSL
+rets-ssl 12109/udp
+cawas 12168/tcp # CA Web Access Service
+cawas 12168/udp
+bprd 13720/tcp # BPRD Protocol (VERITAS NetBackup)
+bprd 13720/udp
+bpdbm 13721/tcp # BPDBM Protocol (VERITAS NetBackup)
+bpdbm 13721/udp
+bpjava-msvc 13722/tcp # BP Java MSVC Protocol
+bpjava-msvc 13722/udp
+vnetd 13724/tcp # Veritas Network Utility
+vnetd 13724/udp
+bpcd 13782/tcp # VERITAS NetBackup
+bpcd 13782/udp
+vopied 13783/tcp # VOPIED Protocol
+vopied 13783/udp
+xpilot 15345/tcp # XPilot Contact Port
+xpilot 15345/udp
+wnn6 22273/tcp # wnn6
+wnn6 22273/udp
+binkp 24554/tcp # Bink fidonet protocol
+binkp 24554/udp
+quake 26000/tcp # Quake @!#
+quake 26000/udp
+wnn6-ds 26208/tcp
+wnn6-ds 26208/udp
+tetrinet 31457/tcp # TetriNET Protocol
+tetrinet 31457/udp
+gamesmith-port 31765/tcp # GameSmith Port
+gamesmith-port 31765/udp
+traceroute 33434/tcp # traceroute use
+traceroute 33434/udp
+candp 42508/tcp # Computer Associates network discovery protocol
+candp 42508/udp
+candrp 42509/tcp # CA discovery response
+candrp 42509/udp
+caerpc 42510/tcp # CA eTrust RPC
+caerpc 42510/udp
+
+#=========================================================================
+# The remaining port numbers are not as allocated by IANA.
+
+# Kerberos (Project Athena/MIT) services
+# Note that these are for Kerberos v4, and are unofficial
+kpop 1109/tcp # Pop with Kerberos
+knetd 2053/tcp # Kerberos de-multiplexor
+eklogin 2105/tcp # Kerberos encrypted rlogin
+
+# CVSup support http://www.cvsup.org/
+supfilesrv 871/tcp # SUP server
+supfiledbg 1127/tcp # SUP debugging
+
+# Datagram Delivery Protocol services
+rtmp 1/ddp # Routing Table Maintenance Protocol
+nbp 2/ddp # Name Binding Protocol
+echo 4/ddp # AppleTalk Echo Protocol
+zip 6/ddp # Zone Information Protocol
+
+# Many services now accepted as 'standard'
+swat 901/tcp # Samba configuration tool
+rndc 953/tcp # rndc control sockets (BIND 9)
+rndc 953/udp
+skkserv 1178/tcp # SKK Japanese input method
+xtel 1313/tcp # french minitel
+support 1529/tcp # GNATS
+cfinger 2003/tcp lmtp # GNU Finger
+ninstall 2150/tcp # ninstall service
+ninstall 2150/udp
+afbackup 2988/tcp # Afbackup system
+afbackup 2988/udp
+fax 4557/tcp # FAX transmission service (old)
+rplay 5555/tcp # RPlay audio service
+rplay 5555/udp
+canna 5680/tcp # Canna (Japanese Input)
+x11-ssh 6010/tcp x11-ssh-offset
+x11-ssh 6010/udp x11-ssh-offset
+ircd 6667/tcp # Internet Relay Chat
+ircd 6667/udp
+jetdirect 9100/tcp # HP JetDirect card
+jetdirect 9100/udp
+mandelspawn 9359/udp mandelbrot # network mandelbrot
+kamanda 10081/tcp # amanda backup services (Kerberos)
+kamanda 10081/udp
+amandaidx 10082/tcp # amanda backup services
+amidxtape 10083/tcp # amanda backup services
+isdnlog 20011/tcp # isdn logging system
+isdnlog 20011/udp
+vboxd 20012/tcp # voice box system
+vboxd 20012/udp
+wnn4_Cn 22289/tcp wnn6_Cn # Wnn (Chinese input)
+wnn4_Kr 22305/tcp wnn6_Kr # Wnn (Korean input)
+wnn4_Tw 22321/tcp wnn6_Tw # Wnn (Taiwanse input)
+asp 27374/tcp # Address Search Protocol
+asp 27374/udp
+tfido 60177/tcp # Ifmail
+tfido 60177/udp
+fido 60179/tcp # Ifmail
+fido 60179/udp
+
+# Local services
diff --git a/test/data/providers/port/parsed/uniq b/test/data/providers/port/parsed/uniq
new file mode 100644
index 0000000..8ed670f
--- /dev/null
+++ b/test/data/providers/port/parsed/uniq
@@ -0,0 +1,7 @@
+# We test a few comments here
+# and anotherone
+ftp-data 20/tcp # File Transfer [Default Data]
+ftp 21/tcp # File Transfer [Control]
+# One comment in the middle
+x11-ssh 6010/tcp x11-ssh-offset # alias test
+baz 100/tcp alias1 alias # Multiple test
--
1.7.3.4

Stefan Schulte

unread,
Dec 23, 2010, 7:04:13 PM12/23/10
to puppe...@googlegroups.com
This new type "port" handles entries in /etc/services. It uses multiple
key_attributes name and protocol, so you are able to add e.g.
multiple telnet lines for tcp and udp. Sample usage

port { 'telnet':
number => '23',
protocol => 'tcp',
description => 'Telnet'
}

Because the type makes use of the title_pattern function this can also
be written as

port { 'telnet:tcp':
number => '23',
description => 'Telnet'
}

This type only supports tcp and udp and might not work on OS X

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660

lib/puppet/type/port.rb | 211 +++++++++++++++-------------------
spec/unit/type/port_spec.rb | 260 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 353 insertions(+), 118 deletions(-)
create mode 100644 spec/unit/type/port_spec.rb

diff --git a/lib/puppet/type/port.rb b/lib/puppet/type/port.rb
index e199885..2087d7c 100755
--- a/lib/puppet/type/port.rb
+++ b/lib/puppet/type/port.rb
@@ -1,119 +1,94 @@
-#module Puppet
-# newtype(:port) do
-# @doc = "Installs and manages port entries. For most systems, these
-# entries will just be in /etc/services, but some systems (notably OS X)
-# will have different solutions."
-#
-# ensurable
-#
-# newproperty(:protocols) do
-# desc "The protocols the port uses. Valid values are *udp* and *tcp*.
-# Most services have both protocols, but not all. If you want
-# both protocols, you must specify that; Puppet replaces the
-# current values, it does not merge with them. If you specify
-# multiple protocols they must be as an array."
-#
-# def is=(value)
-# case value
-# when String
-# @is = value.split(/\s+/)
-# else
-# @is = value


-# end
-# end
-#

-# def is
-# @is
-# end
-#
-# # We actually want to return the whole array here, not just the first
-# # value.
-# def should
-# if defined?(@should)
-# if @should[0] == :absent
-# return :absent
-# else
-# return @should
-# end
-# else
-# return nil


-# end
-# end
-#

-# validate do |value|
-# valids = ["udp", "tcp", "ddp", :absent]
-# unless valids.include? value
-# raise Puppet::Error,
-# "Protocols can be either 'udp' or 'tcp', not #{value}"
-# end


-# end
-# end
-#

-# newproperty(:number) do
-# desc "The port number."
-# end
-#
-# newproperty(:description) do
-# desc "The port description."
-# end
-#
-# newproperty(:port_aliases) do
-# desc 'Any aliases the port might have. Multiple values must be
-# specified as an array. Note that this property is not the same as
-# the "alias" metaparam; use this property to add aliases to a port
-# in the services file, and "alias" to aliases for use in your Puppet
-# scripts.'
-#
-# # We actually want to return the whole array here, not just the first
-# # value.
-# def should
-# if defined?(@should)
-# if @should[0] == :absent
-# return :absent
-# else
-# return @should
-# end
-# else
-# return nil


-# end
-# end
-#

-# validate do |value|
-# if value.is_a? String and value =~ /\s/
-# raise Puppet::Error,
-# "Aliases cannot have whitespace in them: %s" %
-# value.inspect


-# end
-# end
-#

-# munge do |value|
-# unless value == "absent" or value == :absent
-# # Add the :alias metaparam in addition to the property
-# @resource.newmetaparam(
-# @resource.class.metaparamclass(:alias), value
-# )
-# end
-# value


-# end
-# end
-#

-# newproperty(:target) do
-# desc "The file in which to store service information. Only used by
-# those providers that write to disk."
-#
-# defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
-# @resource.class.defaultprovider.default_target
-# else
-# nil
-# end
-# }
-# end
-#
-# newparam(:name) do
-# desc "The port name."
-#
-# isnamevar
-# end
-# end
-#end
+module Puppet
+ newtype(:port) do
+ @doc = "Installs and manages port entries. For most systems, these
+ entries will just be in /etc/services, but some systems (notably OS X)
+ will have different solutions."

+ def self.title_patterns
+ [
+ # we just have one titlepattern "name:protocol"
+ [
+ /^(.*?)(?::(tcp|udp))?$/, # Regex to parse title
+ [
+ # We don't need a lot of postparsing
+ [ :name, lambda{|x| x} ],
+ [ :protocol, lambda{ |x| x.intern unless x.nil? } ],
+ ]
+ ]
+ ]
+ end
+
+ ensurable
+
+ newparam(:name) do
+ desc "The port name."
+
+ validate do |value|
+ raise Puppet::Error "Portname cannot have whitespaces in them" if value =~ /\s/
+ end
+
+ isnamevar
+ end
+
+ newparam(:protocol) do
+ desc "The protocols the port uses. Valid values are *udp* and *tcp*.
+ Most services have both protocols, but not all. If you want both
+ protocols you have to define two resources. You can define both
+ resources with the same title as long as the combination of
+ resourcetitle and protocol is uniq. Keep in mind that if another
+ resource requires Port['title'] it requires both resources"
+
+ newvalues :tcp, :udp
+
+ defaultto :tcp
+
+ isnamevar
+ end
+
+
+ newproperty(:number) do
+ desc "The port number."
+
+ validate do |value|
+ raise Puppet::Error, "number has to be numeric, not #{value}" unless value =~ /^[0-9]+$/
+ raise Puppet::Error, "number #{value} out of range" unless (0...2**16).include?(Integer(value))


+ end
+ end
+

+ newproperty(:description) do
+ desc "The port description."
+ end
+
+ newproperty(:port_aliases, :parent => Puppet::Property::OrderedList) do
+ desc "Any aliases the port might have. Multiple values must be
+ specified as an array."
+
+ def inclusive?
+ true
+ end
+
+ def delimiter
+ " "
+ end
+
+ validate do |value|
+ raise Puppet::Error, "Aliases cannot have whitespaces in them" if value =~ /\s/


+ end
+ end
+
+

+ newproperty(:target) do
+ desc "The file in which to store service information. Only used by
+ those providers that write to disk."
+
+ defaultto do
+ if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
+ @resource.class.defaultprovider.default_target
+ else
+ nil
+ end
+ end
+ end
+
+ end
+end
diff --git a/spec/unit/type/port_spec.rb b/spec/unit/type/port_spec.rb
new file mode 100644
index 0000000..f23ea2b
--- /dev/null
+++ b/spec/unit/type/port_spec.rb
@@ -0,0 +1,260 @@
+#!/usr/bin/env ruby
+
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'puppet/property/ordered_list'
+
+port = Puppet::Type.type(:port)
+
+describe port do
+ before do
+ @class = port
+ @provider_class = stub 'provider_class', :name => 'fake', :ancestors => [], :suitable? => true, :supports_parameter? => true
+ @class.stubs(:defaultprovider).returns @provider_class
+ @class.stubs(:provider).returns @provider_class
+
+ @provider = stub 'provider', :class => @provider_class, :clean => nil, :exists? => false
+ @resource = stub 'resource', :resource => nil, :provider => @provider
+
+ @provider.stubs(:port_aliases).returns :absent
+
+ @provider_class.stubs(:new).returns(@provider)
+ @catalog = Puppet::Resource::Catalog.new
+ end
+
+ it "should have a title pattern that splits name and protocol" do
+ regex = @class.title_patterns[0][0]
+ regex.match("telnet:tcp").captures.should == ['telnet','tcp' ]
+ regex.match("telnet:udp").captures.should == ['telnet','udp' ]
+ regex.match("telnet:baz").captures.should == ['telnet:baz',nil ]
+ end
+
+ it "should have two key_attributes" do
+ @class.key_attributes.size.should == 2
+ end
+
+ it "should have :name as a key_attribute" do
+ @class.key_attributes.should include :name
+ end
+
+ it "should have :protocol as a key_attribute" do
+ @class.key_attributes.should include :protocol
+ end
+
+ describe "when validating attributes" do
+
+ [:name, :provider, :protocol].each do |param|
+ it "should have a #{param} parameter" do
+ @class.attrtype(param).should == :param


+ end
+ end
+

+ [:ensure, :port_aliases, :description, :number].each do |property|
+ it "should have #{property} property" do
+ @class.attrtype(property).should == :property


+ end
+ end
+

+ it "should have a list port_aliases" do
+ @class.attrclass(:port_aliases).ancestors.should include Puppet::Property::OrderedList


+ end
+
+ end
+

+ describe "when validating values" do
+
+ it "should support present as a value for ensure" do
+ lambda { @class.new(:name => "whev", :protocol => :tcp, :ensure => :present) }.should_not raise_error
+ end
+
+ it "should support absent as a value for ensure" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :ensure => :absent) }.should_not raise_error
+ end
+
+ it "should support :tcp as a value for protocol" do
+ proc { @class.new(:name => "whev", :protocol => :tcp) }.should_not raise_error
+ end
+
+ it "should support :udp as a value for protocol" do
+ proc { @class.new(:name => "whev", :protocol => :udp) }.should_not raise_error
+ end
+
+ it "should not support other protocols than tcp and udp" do
+ proc { @class.new(:name => "whev", :protocol => :tcpp) }.should raise_error(Puppet::Error)
+ end
+
+ it "should use tcp as default protocol" do
+ port_test = @class.new(:name => "whev")
+ port_test[:protocol].should == :tcp
+ end
+
+ it "should support valid portnumbers" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => '0') }.should_not raise_error
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => '1') }.should_not raise_error
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "#{2**16-1}") }.should_not raise_error
+ end
+
+ it "should not support portnumbers that arent numeric" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "aa") }.should raise_error(Puppet::Error)
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "22a") }.should raise_error(Puppet::Error)
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "a22") }.should raise_error(Puppet::Error)
+ end
+
+ it "should not support portnumbers that are out of range" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "-1") }.should raise_error(Puppet::Error)
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "#{2**16}") }.should raise_error(Puppet::Error)
+ end
+
+ it "should support single port_alias" do
+ proc { @class.new(:name => "foo", :protocol => :tcp, :port_aliases => 'bar') }.should_not raise_error
+ end
+
+ it "should support multiple port_aliases" do
+ proc { @class.new(:name => "foo", :protocol => :tcp, :port_aliases => ['bar','bar2']) }.should_not raise_error
+ end
+
+ it "should not support whitespaces in any port_alias" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :port_aliases => ['bar','fo o']) }.should raise_error(Puppet::Error)
+ end
+
+ it "should not support whitespaces in resourcename" do
+ proc { @class.new(:name => "foo bar", :protocol => :tcp) }.should raise_error(Puppet::Error)
+ end
+
+ it "should not allow a resource with no name" do
+ proc { @class.new(:protocol => :tcp) }.should raise_error(Puppet::Error)
+ end
+
+ it "should allow a resource with no protocol when the default is tcp" do
+ proc { @class.new(:name => "foo") }.should_not raise_error(Puppet::Error)
+ end
+
+ it "should not allow a resource with no protocol when we have no default" do
+ @class.attrclass(:protocol).stubs(:method_defined?).with(:default).returns(false)
+ proc { @class.new(:name => "foo") }.should raise_error(Puppet::Error)
+ end
+
+ it "should extract name and protocol from title if not explicitly set" do
+ res = @class.new(:title => 'telnet:tcp', :number => '23')
+ res[:number].should == '23'
+ res[:name].should == 'telnet'
+ res[:protocol].should == :tcp
+ end
+
+ it "should not extract name from title if explicitly set" do
+ res = @class.new(:title => 'telnet:tcp', :name => 'ssh', :number => '23')
+ res[:number].should == '23'
+ res[:name].should == 'ssh'
+ res[:protocol].should == :tcp
+ end
+
+ it "should not extract protocol from title if explicitly set" do
+ res = @class.new(:title => 'telnet:tcp', :protocol => :udp, :number => '23')
+ res[:number].should == '23'
+ res[:name].should == 'telnet'
+ res[:protocol].should == :udp
+ end
+
+ it "should not extract name and protocol from title when they are explicitly set" do
+ res = @class.new(:title => 'foo:udp', :name => 'bar', :protocol => :tcp, :number => '23')
+ res[:number].should == '23'
+ res[:name].should == 'bar'
+ res[:protocol].should == :tcp
+ end
+
+ end
+
+ describe "when syncing" do
+
+ it "should send the first value to the provider for number property" do
+ number = @class.attrclass(:number).new(:resource => @resource, :should => %w{100 200})
+ @provider.expects(:number=).with '100'
+ number.sync
+ end
+
+ it "should send the joined array to the provider for port_aliases property" do
+ port_aliases = @class.attrclass(:port_aliases).new(:resource => @resource, :should => %w{foo bar})
+ @provider.expects(:port_aliases=).with 'foo bar'
+ port_aliases.sync
+ end
+
+ it "should care about the order of port_aliases" do
+ port_aliases = @class.attrclass(:port_aliases).new(:resource => @resource, :should => %w{a z b})
+ port_aliases.insync?(%w{a z b}).should == true
+ port_aliases.insync?(%w{a b z}).should == false
+ port_aliases.insync?(%w{b a z}).should == false
+ port_aliases.insync?(%w{z a b}).should == false
+ port_aliases.insync?(%w{z b a}).should == false
+ port_aliases.insync?(%w{b z a}).should == false


+ end
+
+ end
+

+ describe "when comparing uniqueness_key of two ports" do
+
+ it "should be equal if name and protocol are the same" do
+ foo_tcp1 = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ foo_tcp2 = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ foo_tcp1.uniqueness_key.should == ['foo', :tcp ]
+ foo_tcp2.uniqueness_key.should == ['foo', :tcp ]
+ foo_tcp1.uniqueness_key.should == foo_tcp2.uniqueness_key
+ end
+
+ it "should not be equal if protocol differs" do
+ foo_tcp = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ foo_udp = @class.new(:name => "foo", :protocol => :udp, :number => '23')
+ foo_tcp.uniqueness_key.should == [ 'foo', :tcp ]
+ foo_udp.uniqueness_key.should == [ 'foo', :udp ]
+ foo_tcp.uniqueness_key.should_not == foo_udp.uniqueness_key
+ end
+
+ it "should not be equal if name differs" do
+ foo_tcp = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ bar_tcp = @class.new(:name => "bar", :protocol => :tcp, :number => '23')
+ foo_tcp.uniqueness_key.should == [ 'foo', :tcp ]
+ bar_tcp.uniqueness_key.should == [ 'bar', :tcp ]
+ foo_tcp.uniqueness_key.should_not == bar_tcp.uniqueness_key
+ end
+
+ it "should not be equal if both name and protocol differ" do
+ foo_tcp = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ bar_udp = @class.new(:name => "bar", :protocol => :udp, :number => '23')
+ foo_tcp.uniqueness_key.should == [ 'foo', :tcp ]
+ bar_udp.uniqueness_key.should == [ 'bar', :udp ]
+ foo_tcp.uniqueness_key.should_not == bar_udp.uniqueness_key


+ end
+
+ end
+

+ describe "when adding resource to a catalog" do
+
+ it "should not allow two resources with the same name and protocol" do
+ res1 = @class.new(:name => "telnet", :protocol => :tcp, :number => '23')
+ res2 = @class.new(:name => "telnet", :protocol => :tcp, :number => '23')
+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should raise_error(Puppet::Resource::Catalog::DuplicateResourceError)
+ end
+
+ it "should allow two resources with different name and protocol" do
+ res1 = @class.new(:name => "telnet", :protocol => :tcp, :number => '23')
+ res2 = @class.new(:name => "git", :protocol => :tcp, :number => '9418')
+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should_not raise_error
+ end
+
+ it "should allow two resources with same name and different protocol" do
+ res1 = @class.new(:title => 'telnet:tcp', :name => 'telnet', :protocol => :tcp, :number => '23')
+ res2 = @class.new(:title => 'telnet:udp', :name => 'telnet', :protocol => :udp, :number => '23')
+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should_not raise_error
+ end
+
+ it "should allow two resources with the same protocol but different names" do
+ res1 = @class.new(:title => 'telnet:tcp', :name => 'telnet', :protocol => :tcp, :number => '23')
+ res2 = @class.new(:title => 'ssh:tcp', :name => 'ssh', :protocol => :tcp, :number => '23')
+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should_not raise_error


+ end
+
+ end
+

+end
--
1.7.3.4

Stefan Schulte

unread,
Jan 5, 2011, 5:41:58 PM1/5/11
to puppe...@googlegroups.com
The default value for a keyattribute like protocol in port.rb does only
work when the titlepattern does not set it (even if the titlepattern
will set the parameter to nil).

Now the first titlepattern searches for tcp or udp (e.g.
telnet:udp) and if this titlepattern does not match the resourcetitle
only :name will be set in the parameter hash. If protocol is not
explicitly set puppet will finally take the default value into account
(which is :tcp)

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660

lib/puppet/type/port.rb | 15 ++++++++++++---
spec/unit/type/port_spec.rb | 9 ++++++++-
2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/lib/puppet/type/port.rb b/lib/puppet/type/port.rb
index e2a4afa..efaa3d8 100755
--- a/lib/puppet/type/port.rb
+++ b/lib/puppet/type/port.rb
@@ -6,13 +6,22 @@ module Puppet

def self.title_patterns
[
- # we just have one titlepattern "name:protocol"
+ # we have two titlepatterns "name" and "name:protocol". We won't use
+ # one pattern (that will eventually set :protocol to nil) because we
+ # want to use a default value for :protocol. And that does only work
+ # if :protocol is not put in the parameter hash while initialising
[
- /^(.*?)(?::(tcp|udp))?$/, # Regex to parse title
+ /^(.*?):(tcp|udp)$/, # Set name and protocol
[


# We don't need a lot of postparsing

[ :name, lambda{|x| x} ],

- [ :protocol, lambda{ |x| x.intern unless x.nil? } ],


+ [ :protocol, lambda{ |x| x.intern unless x.nil? } ]

+ ]
+ ],
+ [
+ /^(.*)$/,
+ [


+ [ :name, lambda{|x| x} ]

]
]
]
diff --git a/spec/unit/type/port_spec.rb b/spec/unit/type/port_spec.rb
index f23ea2b..8f22231 100644
--- a/spec/unit/type/port_spec.rb
+++ b/spec/unit/type/port_spec.rb
@@ -25,7 +25,14 @@ describe port do


regex = @class.title_patterns[0][0]

regex.match("telnet:tcp").captures.should == ['telnet','tcp' ]

regex.match("telnet:udp").captures.should == ['telnet','udp' ]

- regex.match("telnet:baz").captures.should == ['telnet:baz',nil ]
+ regex.match("telnet:baz").should == nil
+ end
+
+ it "should have a second title pattern that will set only name" do
+ regex = @class.title_patterns[1][0]
+ regex.match("telnet:tcp").captures.should == ['telnet:tcp' ]
+ regex.match("telnet:udp").captures.should == ['telnet:udp' ]
+ regex.match("telnet:baz").captures.should == ['telnet:baz' ]
end



it "should have two key_attributes" do

--
1.7.3.4

Jacob Helwig

unread,
Mar 21, 2011, 6:42:33 PM3/21/11
to puppe...@googlegroups.com

Stefan,

I started taking a look at the patch series, but it doesn't look like
the tests run at all. I get an error about trying to use
pupepttest/support/utils

/home/jhelwig/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- puppettest/support/utils (LoadError)
from /home/jhelwig/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/jhelwig/work/puppet/spec/unit/provider/port/parsed_spec.rb:6
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `autorun'
from /home/jhelwig/.rvm/gems/ruby-1.8.7-p302@rspec2/bin/rspec:19

It looks like the new test is the only one attempting to use puppettest
from within the spec test framework. It looks like this will need to
get sorted out before we can merge it in.

I'm assuming that these tests are running fine for you. Anything I
should be aware of to get them running on my end?

As an aside, I started cleaning up some of the grammar, and tweaking
some of the error messages (diff below).

diff --git i/lib/puppet/type/port.rb w/lib/puppet/type/port.rb
index e2a4afa..7e04ed5 100755
--- i/lib/puppet/type/port.rb
+++ w/lib/puppet/type/port.rb
@@ -1,16 +1,16 @@
module Puppet
newtype(:port) do
- @doc = "Installs and manages port entries. For most systems, these
+ @doc = "Install and manage port entries. For most systems, these


entries will just be in /etc/services, but some systems (notably OS X)

will have different solutions."



def self.title_patterns
[
- # we just have one titlepattern "name:protocol"

+ # we just have one title_pattern "name:protocol"
[


/^(.*?)(?::(tcp|udp))?$/, # Regex to parse title

[
- # We don't need a lot of postparsing
+ # We don't need a lot of post-parsing


[ :name, lambda{|x| x} ],

[ :protocol, lambda{ |x| x.intern unless x.nil? } ],

]
@@ -24,20 +24,20 @@ module Puppet
desc "The port name."

validate do |value|
- raise Puppet::Error "Portname cannot have whitespaces in them" if value =~ /\s/
+ raise Puppet::Error "Port name cannot have whitespaces in it" if value =~ /\s/
end

isnamevar
end

newparam(:protocol) do
- desc "The protocols the port uses. Valid values are *udp* and *tcp*.
+ desc "The protocol the port uses. Valid values are *udp* and *tcp*.


Most services have both protocols, but not all. If you want both

protocols you have to define two resources. Remeber that you cannot


specify two resources with the same title but you can use a title

to set both, name and protocol if you use ':' as a seperator. So

- port { 'telnet:tcp': ... } sets both name and protocol and you dont
- have to specify them explicitly then"
+ port { 'telnet:tcp': ... } sets both name and protocol and you don't
+ have to specify them explicitly."

newvalues :tcp, :udp

@@ -46,18 +46,17 @@ module Puppet
isnamevar
end

-
newproperty(:number) do
desc "The port number."

validate do |value|


raise Puppet::Error, "number has to be numeric, not #{value}" unless value =~ /^[0-9]+$/

- raise Puppet::Error, "number #{value} out of range" unless (0...2**16).include?(Integer(value))
+ raise Puppet::Error, "number #{value} out of range (0-65535)" unless 0 <= Integer(value) && 2**16 > Integer(value)
end
end

newproperty(:description) do
- desc "The port description."
+ desc "The description for the port."
end



newproperty(:port_aliases, :parent => Puppet::Property::OrderedList) do

@@ -73,11 +72,10 @@ module Puppet
end

validate do |value|
- raise Puppet::Error, "Aliases cannot have whitespaces in them" if value =~ /\s/
+ raise Puppet::Error, "Aliases must not contain whitespace: #{value}" if value =~ /\s/
end
end

-
newproperty(:target) do


desc "The file in which to store service information. Only used by

those providers that write to disk."

@@ -90,6 +88,5 @@ module Puppet
end
end
end
-
end
end

--
Jacob Helwig

signature.asc

Stefan Schulte

unread,
Mar 22, 2011, 3:40:36 AM3/22/11
to puppe...@googlegroups.com

I tried to run the tests but I got rspec failures. I guess it's because
I just have rspec2 installed now and was using rspec1 when I wrote the
tests. After rebasing on current next I got the same error you have.

I will spend some time today to work that one out.

In general the tests may be insufficient because I just did tests on my
private machine. If you have any suggestions about additional test cases
or know of some special behaviour on platform X I'll be happy to improve
the current specs.

just out of curiosity: Will (0...2**16) generate just a huge array with
include? beeing extreamly slow or does ruby handle ranges of integers
differently?


-Stefan

Markus Roberts

unread,
Mar 22, 2011, 10:38:54 AM3/22/11
to puppe...@googlegroups.com
>        validate do |value|
>          raise Puppet::Error, "number has to be numeric, not #{value}" unless value =~ /^[0-9]+$/
> -        raise Puppet::Error, "number #{value} out of range" unless (0...2**16).include?(Integer(value))

just out of curiosity: Will (0...2**16) generate just a huge array with
include? beeing extreamly slow or does ruby handle ranges of integers
differently?

It's good.  Ranges aren't arrays (you can convert them to arrays, but it doesn't happen implicitly); they are two element structures (a low value/high value pair).  That allows you to do things like 1.14..3.14, and 5..-1 which wouldn't work as arrays.  As for the performance aspect, go into irb and try:

    (0..2**2000).include? 1234

It comes back immediately without prompting you to purchase more ram.  :)

It definitely pays to be on the lookout for things like this because small differences in idiom can (like the case in rails a few years ago http://kevin.scaldeferri.com/blog/, or our make-and-throw-away-arrays issue in rest #6257) be significant performance hits, so thanks for asking.

-- M
------------------------------------------------------------
When in trouble or in doubt, run in circles,
scream and shout. -- 1920's parody of the 
maritime general prudential rule
------------------------------------------------------------

Stefan Schulte

unread,
Mar 22, 2011, 6:35:09 PM3/22/11
to puppe...@googlegroups.com

The tests now work
- The provider-spec for the port type now uses the
»all_parsedfile_providers« helper to test correct file parsing.
- add a validate function to satisfy a failing test
- improve documentation of the type (including your corrections)
- changed separator in the title_pattern from : to /. This is the same
separator you can use when running getent (e.g. you can run »getent
services telnet/tcp« and get the correct line)

I rebased on current next and squashed a few commits into a single one because I think
it is easier for you to review them this way. If you disagree please let me know and
I can send diffs based on the last patch series.

There is currently one problem I'm trying to address tomorrow: All tests pass (at least
on my system) while prefetch is still broken (#5605) so I want to at least add a test
that will show this misbehaviour.

-Stefan

Stefan Schulte

unread,
Mar 22, 2011, 6:35:11 PM3/22/11
to puppe...@googlegroups.com
This provider uses parsedfile to parse entries in /etc/services. Because
we use composite keys we have to provide an individual match method to
find resources for a single record.

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660N
lib/puppet/provider/port/parsed.rb | 228 +---
lib/puppet/type/port.rb | 6 +
spec/fixtures/unit/provider/port/parsed/nonuniq | 6 +
.../unit/provider/port/parsed/realworld_linux | 1179 ++++++++++++++++++++
spec/fixtures/unit/provider/port/parsed/uniq | 7 +
spec/unit/provider/port/parsed_spec.rb | 278 +++++
6 files changed, 1534 insertions(+), 170 deletions(-)
create mode 100644 spec/fixtures/unit/provider/port/parsed/nonuniq
create mode 100644 spec/fixtures/unit/provider/port/parsed/realworld_linux
create mode 100644 spec/fixtures/unit/provider/port/parsed/uniq
create mode 100644 spec/unit/provider/port/parsed_spec.rb

-# end
-#


-# # Else, merge the two records into one.
-# return port_merge(*hashes)

-# end
-#


-# # Override how we split into lines, so that we always treat both protocol
-# # lines as a single line. This drastically simplifies merging the two lines
-# # into one record.
-# def self.lines(text)
-# names = {}
-# lines = []
-#
-# # We organize by number, because that's apparently how the ports work.
-# # You'll never be able to use Puppet to manage multiple entries
-# # with the same name but different numbers, though.
-# text.split("\n").each do |line|
-# if line =~ /^([-\w]+)\s+(\d+)\/[^d]/ # We want to skip ddp proto stuff
-# names[$1] ||= []
-# names[$1] << line
-# lines << [:special, $1]
-# else
-# lines << line

-# end
-# end
-#

-# # Now, return each line in order, but join the ones with the same name
-# lines.collect do |line|
-# if line.is_a?(Array)
-# name = line[1]
-# if names[name]
-# t = names[name].join("\n")
-# names.delete(name)
-# t

-# end
-# else


-# line
-# end
-# end.reject { |l| l.nil? }

-# end
-#


-# # Parse a single port line, returning a hash.
-# def self.parse_port(line)
-# hash = {}
-# if line.sub!(/^(\S+)\s+(\d+)\/(\w+)\s*/, '')
-# hash[:name] = $1
-# hash[:number] = $2
-# hash[:protocols] = [$3]
-#
-# unless line == ""
-# line.sub!(/^([^#]+)\s*/) do |value|
-# aliases = $1
-#
-# # Remove any trailing whitespace
-# aliases.strip!
-# unless aliases =~ /^\s*$/
-# hash[:alias] = aliases.split(/\s+/)

-# end
-#
-# ""


-# end
-#
-# line.sub!(/^\s*#\s*(.+)$/) do |value|
-# desc = $1
-# unless desc =~ /^\s*$/
-# hash[:description] = desc.sub(/\s*$/, '')

-# end
-#
-# ""
-# end
-# end
-# else


-# if line =~ /^\s+\d+/ and
-# Facter["operatingsystem"].value == "Darwin"
-# #Puppet.notice "Skipping wonky OS X port entry %s" %
-# # line.inspect
-# next
-# end
-# Puppet.notice "Ignoring unparseable line '#{line}' in #{self.target}"
-# end
-#
-# if hash.empty?
-# return nil
-# else
-# return hash

-# end
-# end
-#

-# # Merge two records into one.
-# def self.port_merge(one, two)
-# keys = [one.keys, two.keys].flatten.uniq
-#
-# # We'll be returning the 'one' hash. so make any necessary modifications
-# # to it.
-# keys.each do |key|
-# # The easy case
-# if one[key] == two[key]
-# next
-# elsif one[key] and ! two[key]
-# next
-# elsif ! one[key] and two[key]
-# one[key] = two[key]
-# elsif one[key].is_a?(Array) and two[key].is_a?(Array)
-# one[key] = [one[key], two[key]].flatten.uniq
-# else
-# # Keep the info from the first hash, so don't do anything
-# #Puppet.notice "Cannot merge %s in %s with %s" %
-# # [key, one.inspect, two.inspect]

-# end
-# end
-#

-# return one
-# end
-#


-# # Convert the current object into one or more services entry.
-# def self.to_line(hash)
-# unless hash[:record_type] == :parsed
-# return super

-# end
-#


-# # Strangely, most sites seem to use tabs as separators.
-# hash[:protocols].collect { |proto|
-# str = "#{hash[:name]}\t\t#{hash[:number]}/#{proto}"
-#
-# if value = hash[:alias] and value != :absent
-# str += "\t\t#{value.join(" ")}"
-# end
-#
-# if value = hash[:description] and value != :absent

-# str += "\t# #{value}"
-# end

diff --git a/lib/puppet/type/port.rb b/lib/puppet/type/port.rb
index f895785..a53d869 100755
--- a/lib/puppet/type/port.rb
+++ b/lib/puppet/type/port.rb
@@ -137,5 +137,11 @@ module Puppet
end
end

+ validate do
+ unless @parameters[:name] and @parameters[:protocol]
+ raise Puppet::Error, "Attributes 'name' and 'protocol' are mandatory"


+ end
+ end
+
end

end
diff --git a/spec/fixtures/unit/provider/port/parsed/nonuniq b/spec/fixtures/unit/provider/port/parsed/nonuniq
new file mode 100644
index 0000000..e4eb25a
--- /dev/null
+++ b/spec/fixtures/unit/provider/port/parsed/nonuniq


@@ -0,0 +1,6 @@
+# We test a few comments here
+# and anotherone
+telnet 23/tcp # Telnet
+telnets 992/tcp # telnet protocol over TLS/SSL
+telnets 992/ud
+telnet 23/udp

diff --git a/spec/fixtures/unit/provider/port/parsed/realworld_linux b/spec/fixtures/unit/provider/port/parsed/realworld_linux
new file mode 100644
index 0000000..f7fd67d
--- /dev/null
+++ b/spec/fixtures/unit/provider/port/parsed/realworld_linux

diff --git a/spec/fixtures/unit/provider/port/parsed/uniq b/spec/fixtures/unit/provider/port/parsed/uniq
new file mode 100644
index 0000000..8ed670f
--- /dev/null
+++ b/spec/fixtures/unit/provider/port/parsed/uniq


@@ -0,0 +1,7 @@
+# We test a few comments here
+# and anotherone
+ftp-data 20/tcp # File Transfer [Default Data]
+ftp 21/tcp # File Transfer [Control]
+# One comment in the middle
+x11-ssh 6010/tcp x11-ssh-offset # alias test
+baz 100/tcp alias1 alias # Multiple test

diff --git a/spec/unit/provider/port/parsed_spec.rb b/spec/unit/provider/port/parsed_spec.rb
new file mode 100644
index 0000000..fce6baf
--- /dev/null
+++ b/spec/unit/provider/port/parsed_spec.rb
@@ -0,0 +1,278 @@
+#!/usr/bin/env ruby
+
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
+
+require 'shared_behaviours/all_parsedfile_providers'
+require 'puppet_spec/files'


+
+provider_class = Puppet::Type.type(:port).provider(:parsed)
+
+describe provider_class do
+ include PuppetSpec::Files
+

+ before do
+ @host_class = Puppet::Type.type(:port)
+ @provider = @host_class.provider(:parsed)
+ @servicesfile = tmpfile('services')
+ @provider.stubs(:default_target).returns @servicesfile
+ @provider.any_instance.stubs(:target).returns @servicesfile
+ end
+
+ after :each do
+ @provider.initvars

+ end
+


+ def mkport(args)
+ portresource = Puppet::Type::Port.new(:name => args[:name], :protocol => args[:protocol])
+ portresource.stubs(:should).with(:target).returns @servicesfile
+
+ # Using setters of provider
+ port = @provider.new(portresource)
+ args.each do |property,value|
+ value = value.join(' ') if property == :port_aliases and value.is_a?(Array)
+ port.send("#{property}=", value)
+ end
+ port

+ end
+


+ def genport(port)
+ @provider.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
+ File.stubs(:chown)
+ File.stubs(:chmod)
+ Puppet::Util::SUIDManager.stubs(:asuser).yields
+ port.flush
+ @provider.target_object(@servicesfile).read

+ end
+


+ describe "when parsing a line with name port and protocol" do
+
+ before do
+ @example_line = "telnet \t 23/udp"

+ end
+


+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == 'telnet'

+ end
+


+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == '23'

+ end
+


+ it "should extract protocol udp from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == :udp

+ end
+


+ it "should extrace protocol tcp from third field" do
+ @provider.parse_line('telnet 23/tcp')[:protocol].should == :tcp

+ end
+


+ it "should drop trailing spaces" do
+ @provider.parse_line('telnet 23/tcp ')[:protocol].should == :tcp

+ end
+


+ it "should handle different delimiters" do
+ @result = ['telnet','23',:tcp ]
+ [
+ "telnet 23/tcp",
+ "telnet\t23/tcp",
+ "telnet \t23/tcp",
+ "telnet\t 23/tcp",
+ "telnet \t 23/tcp\t\t"
+ ].each do |sample|
+ hash = @provider.parse_line(sample)
+ hash[:name].should == @result[0]
+ hash[:number].should == @result[1]
+ hash[:protocol].should == @result[2]
+ hash[:description].should == ''

+ end
+ end
+
+ end

+
+ describe "when parsing a line with name, port, protocol, description" do
+
+ before do
+ @example_line = "telnet \t 23/udp # Telnet"

+ end
+


+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == 'telnet'

+ end
+


+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == '23'

+ end
+


+ it "should extract protocol from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == :udp

+ end
+


+ it "should extract description after the first #" do
+ @provider.parse_line(@example_line)[:description].should == 'Telnet'

+ end
+


+ it "should correctly set description with multiple #" do
+ @provider.parse_line('telnet 23/udp # My # desc')[:description].should == 'My # desc'

+ end
+


+ it "should handle different delimiters" do
+ @result = ['telnet', '23', :udp, 'My # desc' ]
+ [
+ "telnet 23/udp # My # desc",
+ "telnet\t 23/udp\t# My # desc",
+ "telnet \t23/udp #\tMy # desc",
+ "telnet \t \t 23/udp \t \t# \tMy # desc"
+ ].each do |sample|
+ hash = @provider.parse_line(sample)
+ hash[:name].should == @result[0]
+ hash[:number].should == @result[1]
+ hash[:protocol].should == @result[2]
+ hash[:description].should == @result[3]

+ end
+
+ end
+

+ end
+


+ describe "when parsing a line with name, number, procotol and aliases" do
+
+ before do
+ @example_line = "telnet \t 23/udp alias1 alias2"

+ end
+


+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == 'telnet'

+ end
+


+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == '23'

+ end
+


+ it "should extract protocol from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == :udp

+ end
+


+ it "should extract single alias" do
+ @example_line = "telnet \t 23/udp alias1"
+ @provider.parse_line(@example_line)[:port_aliases].should == 'alias1'

+ end
+


+ it "should extract multiple aliases" do
+ @provider.parse_line(@example_line)[:port_aliases].should == 'alias1 alias2'

+ end
+


+ it "should convert delimiter to single space" do
+ @provider.parse_line("telnet 23/udp alias1\t\t alias2\talias3 alias4")[:port_aliases].should == 'alias1 alias2 alias3 alias4'

+ end
+


+ it "should set port_aliases to :absent if there is none" do
+ @provider.parse_line("telnet 23/udp")[:port_aliases].should == :absent
+ @provider.parse_line("telnet 23/udp ")[:port_aliases].should == :absent
+ @provider.parse_line("telnet 23/udp # Bazinga!")[:port_aliases].should == :absent

+ end
+
+ end
+

+ describe "when parsing a line with name, number, protocol, aliases and description" do
+
+ before do
+ @example_line = "telnet \t 23/udp alias1 alias2 # Tel#net"
+ @result = ['telnet','23',:udp,'alias1 alias2','Tel#net']

+ end
+


+ it "should extrace name from the first field" do
+ @provider.parse_line(@example_line)[:name].should == @result[0]

+ end
+


+ it "should extract number from second field" do
+ @provider.parse_line(@example_line)[:number].should == @result[1]

+ end
+


+ it "should extract protocol from third field" do
+ @provider.parse_line(@example_line)[:protocol].should == @result[2]

+ end
+


+ it "should extract aliases from forth field" do
+ @provider.parse_line(@example_line)[:port_aliases].should == @result[3]

+ end
+


+ it "should extract description from the fifth field" do
+ @provider.parse_line(@example_line)[:description].should == @result[4]

+ end
+
+ end
+

+ describe "when operating on /etc/services like files" do
+

+ it_should_behave_like "all parsedfile providers", provider_class
+
+ end
+


+ it "should be able to generate a simple services entry" do
+ port = mkport(
+ :name => 'telnet',
+ :protocol => :tcp,
+ :number => '23',
+ :ensure => :present
+ )
+ genport(port).should == "telnet\t23/tcp\n"

+ end
+


+ it "should be able to generate an entry with one alias" do
+ port = mkport(
+ :name => 'pcx-pin',
+ :protocol => :tcp,
+ :number => '4005',
+ :port_aliases => 'pcx-pin',
+ :ensure => :present
+ )
+ genport(port).should == "pcx-pin\t4005/tcp\tpcx-pin\n"

+ end
+


+ it "should be able to generate an entry with more than one alias" do
+ port = mkport(
+ :name => 'pcx-splr-ft',
+ :protocol => :udp,
+ :number => '4003',
+ :port_aliases => [ 'pcx-splr-ft', 'rquotad' ],
+ :ensure => :present
+ )
+ genport(port).should == "pcx-splr-ft\t4003/udp\tpcx-splr-ft rquotad\n"

+ end
+


+ it "should be able to generate a simple hostfile entry with comments" do
+ port = mkport(
+ :name => 'telnet',
+ :protocol => :tcp,
+ :number => '23',
+ :description => 'Fancy # comment',
+ :ensure => :present
+ )
+ genport(port).should == "telnet\t23/tcp\t# Fancy # comment\n"

+ end
+


+ it "should be able to generate an entry with one alias and a comment" do
+ port = mkport(
+ :name => 'foo',
+ :protocol => :tcp,
+ :number => '1',
+ :port_aliases => 'bar',
+ :description => 'Bazinga!',
+ :ensure => :present
+ )
+ genport(port).should == "foo\t1/tcp\tbar\t# Bazinga!\n"

+ end
+


+ it "should be able to generate an entry with more than one alias and a comment" do
+ port = mkport(
+ :name => 'foo',
+ :protocol => :udp,
+ :number => '3000',
+ :port_aliases => [ 'bar', 'baz', 'zap' ],
+ :description => 'Bazinga!',
+ :ensure => :present
+ )
+ genport(port).should == "foo\t3000/udp\tbar baz zap\t# Bazinga!\n"

+ end
+
+end
--

1.7.4.1

Stefan Schulte

unread,
Mar 22, 2011, 6:35:10 PM3/22/11
to puppe...@googlegroups.com
This new type "port" handles entries in /etc/services. It uses multiple
key_attributes (name and protocol), so you are able to add e.g.

multiple telnet lines for tcp and udp. Sample usage

port { 'telnet':
number => '23',
protocol => 'tcp',
description => 'Telnet'
}

Because the type makes use of the title_patterns function this can also
be written as

port { 'telnet/tcp':


number => '23',
description => 'Telnet'
}

This type only supports tcp and udp and might not work on OS X

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660N
lib/puppet/type/port.rb | 258 ++++++++++++++++++++++-------------------
spec/unit/type/port_spec.rb | 270 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 410 insertions(+), 118 deletions(-)
create mode 100644 spec/unit/type/port_spec.rb

diff --git a/lib/puppet/type/port.rb b/lib/puppet/type/port.rb
index e199885..f895785 100755
--- a/lib/puppet/type/port.rb
+++ b/lib/puppet/type/port.rb
@@ -1,119 +1,141 @@


-#module Puppet
-# newtype(:port) do
-# @doc = "Installs and manages port entries. For most systems, these
-# entries will just be in /etc/services, but some systems (notably OS X)
-# will have different solutions."
-#
-# ensurable
-#
-# newproperty(:protocols) do
-# desc "The protocols the port uses. Valid values are *udp* and *tcp*.
-# Most services have both protocols, but not all. If you want
-# both protocols, you must specify that; Puppet replaces the
-# current values, it does not merge with them. If you specify
-# multiple protocols they must be as an array."
-#
-# def is=(value)
-# case value
-# when String
-# @is = value.split(/\s+/)
-# else
-# @is = value

-# end
-# end
-#

-# def is
-# @is
-# end
-#


-# # We actually want to return the whole array here, not just the first
-# # value.
-# def should
-# if defined?(@should)
-# if @should[0] == :absent
-# return :absent
-# else
-# return @should

-# end
-# else
-# return nil


-# end
-# end
-#

-# validate do |value|
-# valids = ["udp", "tcp", "ddp", :absent]
-# unless valids.include? value
-# raise Puppet::Error,

-# "Protocols can be either 'udp' or 'tcp', not #{value}"
-# end


-# end
-# end
-#

-# newproperty(:number) do
-# desc "The port number."
-# end
-#
-# newproperty(:description) do
-# desc "The port description."
-# end
-#
-# newproperty(:port_aliases) do
-# desc 'Any aliases the port might have. Multiple values must be
-# specified as an array. Note that this property is not the same as
-# the "alias" metaparam; use this property to add aliases to a port
-# in the services file, and "alias" to aliases for use in your Puppet
-# scripts.'
-#
-# # We actually want to return the whole array here, not just the first
-# # value.
-# def should
-# if defined?(@should)
-# if @should[0] == :absent
-# return :absent
-# else
-# return @should

-# end
-# else
-# return nil


-# end
-# end
-#

-# validate do |value|
-# if value.is_a? String and value =~ /\s/
-# raise Puppet::Error,
-# "Aliases cannot have whitespace in them: %s" %
-# value.inspect

-# end
-# end
-#

-# munge do |value|
-# unless value == "absent" or value == :absent
-# # Add the :alias metaparam in addition to the property
-# @resource.newmetaparam(
-# @resource.class.metaparamclass(:alias), value
-# )
-# end
-# value

-# end
-# end
-#

-# newproperty(:target) do
-# desc "The file in which to store service information. Only used by
-# those providers that write to disk."
-#
-# defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
-# @resource.class.defaultprovider.default_target
-# else
-# nil
-# end

-# }
-# end
-#


-# newparam(:name) do
-# desc "The port name."
-#
-# isnamevar
-# end
-# end
-#end

+require 'puppet/property/ordered_list'



+module Puppet
+ newtype(:port) do

+ @doc = "Installs and manages port entries. For most systems, these
+ entries will just be in `/etc/services`, but some systems (notably OS X)


+ will have different solutions.
+

+ This type uses a composite key of (port) `name` and (port) `number` to
+ identify a resource. You are able to set both keys with the resource
+ title if you seperate them with a slash. So instead of specifying protocol
+ explicitly:
+
+ port { \"telnet\":
+ protocol => tcp,
+ number => 23,
+ }
+
+ you can also specify both name and protocol implicitly through the title:
+
+ port { \"telnet/tcp\":
+ number => 23,
+ }
+
+ The second way is the prefered way if you want to specifiy a port that
+ uses both tcp and udp as a protocol. You need to define two resources
+ for such a port but the resource title still has to be uniq.
+
+ Example: To make sure you have the telnet port in your `/etc/services`
+ file you will now write:
+
+ port { \"telnet/tcp\":
+ number => 23,
+ }
+ port { \"telnet/udp\":
+ number => 23,
+ }
+
+ Currently only tcp and udp are supported and recognised when setting
+ the protocol via the title."
+
+ def self.title_patterns
+ [
+ # we have two title_patterns "name" and "name:protocol". We won't use


+ # one pattern (that will eventually set :protocol to nil) because we
+ # want to use a default value for :protocol. And that does only work
+ # if :protocol is not put in the parameter hash while initialising

+ [
+ /^(.*?)\/(tcp|udp)$/, # Set name and protocol
+ [


+ # We don't need a lot of post-parsing

+ [ :name, lambda{|x| x} ],


+ [ :protocol, lambda{ |x| x.intern unless x.nil? } ]
+ ]
+ ],
+ [
+ /^(.*)$/,
+ [
+ [ :name, lambda{|x| x} ]

+ ]
+ ]
+ ]
+ end
+


+ ensurable
+
+ newparam(:name) do
+ desc "The port name."
+
+ validate do |value|

+ raise Puppet::Error "Port name must not contain whitespace: #{value}" if value =~ /\s/


+ end
+
+ isnamevar
+ end
+
+ newparam(:protocol) do

+ desc "The protocol the port uses. Valid values are *udp* and *tcp*.

+ Most services have both protocols, but not all. If you want both
+ protocols you have to define two resources. Remeber that you cannot
+ specify two resources with the same title but you can use a title
+ to set both, name and protocol if you use ':' as a seperator. So
+ port { \"telnet/tcp\": ... } sets both name and protocol and you don't


+ have to specify them explicitly."

+
+ newvalues :tcp, :udp
+
+ defaultto :tcp
+
+ isnamevar
+ end
+
+
+ newproperty(:number) do
+ desc "The port number."
+
+ validate do |value|

+ raise Puppet::Error, "number has to be numeric, not #{value}" unless value =~ /^[0-9]+$/
+ raise Puppet::Error, "number #{value} out of range (0-65535)" unless (0...2**16).include?(Integer(value))


+ end
+
+ end
+

+ newproperty(:description) do
+ desc "The description for the port. The description will appear"
+ "as a comment in the `/etc/services` file"


+ end
+
+ newproperty(:port_aliases, :parent => Puppet::Property::OrderedList) do
+ desc "Any aliases the port might have. Multiple values must be
+ specified as an array."
+
+ def inclusive?
+ true

+ end
+
+ def delimiter
+ " "
+ end
+
+ validate do |value|


+ raise Puppet::Error, "Aliases must not contain whitespace: #{value}" if value =~ /\s/

+ end
+ end
+
+

+ newproperty(:target) do
+ desc "The file in which to store service information. Only used by
+ those providers that write to disk."
+
+ defaultto do
+ if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
+ @resource.class.defaultprovider.default_target
+ else
+ nil

+ end
+ end
+ end

+
+ end
+end
diff --git a/spec/unit/type/port_spec.rb b/spec/unit/type/port_spec.rb
new file mode 100644
index 0000000..8386ae5
--- /dev/null
+++ b/spec/unit/type/port_spec.rb
@@ -0,0 +1,270 @@
+#!/usr/bin/env ruby
+


+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'puppet/property/ordered_list'
+

+port = Puppet::Type.type(:port)
+


+describe port do
+ before do
+ @class = port
+ @provider_class = stub 'provider_class', :name => 'fake', :ancestors => [], :suitable? => true, :supports_parameter? => true
+ @class.stubs(:defaultprovider).returns @provider_class
+ @class.stubs(:provider).returns @provider_class
+
+ @provider = stub 'provider', :class => @provider_class, :clean => nil, :exists? => false
+ @resource = stub 'resource', :resource => nil, :provider => @provider
+
+ @provider.stubs(:port_aliases).returns :absent
+
+ @provider_class.stubs(:new).returns(@provider)
+ @catalog = Puppet::Resource::Catalog.new

+ end
+
+ it "should have a title pattern that splits name and protocol" do
+ regex = @class.title_patterns[0][0]
+ regex.match("telnet/tcp").captures.should == ['telnet','tcp' ]
+ regex.match("telnet/udp").captures.should == ['telnet','udp' ]
+ regex.match("telnet/baz").should == nil
+ end
+


+ it "should have a second title pattern that will set only name" do
+ regex = @class.title_patterns[1][0]

+ regex.match("telnet/tcp").captures.should == ['telnet/tcp' ]
+ regex.match("telnet/udp").captures.should == ['telnet/udp' ]
+ regex.match("telnet/baz").captures.should == ['telnet/baz' ]
+ end
+


+ it "should have two key_attributes" do

+ @class.key_attributes.size.should == 2
+ end
+


+ it "should have :name as a key_attribute" do
+ @class.key_attributes.should include :name

+ end
+


+ it "should have :protocol as a key_attribute" do
+ @class.key_attributes.should include :protocol

+ end
+


+ describe "when validating attributes" do
+
+ [:name, :provider, :protocol].each do |param|
+ it "should have a #{param} parameter" do
+ @class.attrtype(param).should == :param

+ end
+ end
+

+ [:ensure, :port_aliases, :description, :number].each do |property|
+ it "should have #{property} property" do
+ @class.attrtype(property).should == :property

+ end
+ end
+

+ it "should have a list port_aliases" do
+ @class.attrclass(:port_aliases).ancestors.should include Puppet::Property::OrderedList

+ end
+
+ end
+

+ describe "when validating values" do
+
+ it "should support present as a value for ensure" do
+ lambda { @class.new(:name => "whev", :protocol => :tcp, :ensure => :present) }.should_not raise_error

+ end
+


+ it "should support absent as a value for ensure" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :ensure => :absent) }.should_not raise_error

+ end
+


+ it "should support :tcp as a value for protocol" do
+ proc { @class.new(:name => "whev", :protocol => :tcp) }.should_not raise_error

+ end
+


+ it "should support :udp as a value for protocol" do
+ proc { @class.new(:name => "whev", :protocol => :udp) }.should_not raise_error

+ end
+


+ it "should not support other protocols than tcp and udp" do
+ proc { @class.new(:name => "whev", :protocol => :tcpp) }.should raise_error(Puppet::Error)

+ end
+


+ it "should use tcp as default protocol" do
+ port_test = @class.new(:name => "whev")

+ port_test[:protocol].should == :tcp
+ end
+


+ it "should support valid portnumbers" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => '0') }.should_not raise_error
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => '1') }.should_not raise_error
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "#{2**16-1}") }.should_not raise_error

+ end
+


+ it "should not support portnumbers that arent numeric" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "aa") }.should raise_error(Puppet::Error)
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "22a") }.should raise_error(Puppet::Error)
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "a22") }.should raise_error(Puppet::Error)

+ end
+


+ it "should not support portnumbers that are out of range" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "-1") }.should raise_error(Puppet::Error)
+ proc { @class.new(:name => "whev", :protocol => :tcp, :number => "#{2**16}") }.should raise_error(Puppet::Error)

+ end
+


+ it "should support single port_alias" do
+ proc { @class.new(:name => "foo", :protocol => :tcp, :port_aliases => 'bar') }.should_not raise_error

+ end
+


+ it "should support multiple port_aliases" do
+ proc { @class.new(:name => "foo", :protocol => :tcp, :port_aliases => ['bar','bar2']) }.should_not raise_error

+ end
+


+ it "should not support whitespaces in any port_alias" do
+ proc { @class.new(:name => "whev", :protocol => :tcp, :port_aliases => ['bar','fo o']) }.should raise_error(Puppet::Error)

+ end
+


+ it "should not support whitespaces in resourcename" do
+ proc { @class.new(:name => "foo bar", :protocol => :tcp) }.should raise_error(Puppet::Error)

+ end
+


+ it "should not allow a resource with no name" do
+ proc { @class.new(:protocol => :tcp) }.should raise_error(Puppet::Error)

+ end
+


+ it "should allow a resource with no protocol when the default is tcp" do
+ proc { @class.new(:name => "foo") }.should_not raise_error(Puppet::Error)

+ end
+


+ it "should not allow a resource with no protocol when we have no default" do
+ @class.attrclass(:protocol).stubs(:method_defined?).with(:default).returns(false)
+ proc { @class.new(:name => "foo") }.should raise_error(Puppet::Error)

+ end
+


+ it "should extract name and protocol from title if not explicitly set" do

+ res = @class.new(:title => 'telnet/tcp', :number => '23')
+ res[:number].should == '23'
+ res[:name].should == 'telnet'
+ res[:protocol].should == :tcp
+ end
+


+ it "should not extract name from title if explicitly set" do

+ res = @class.new(:title => 'telnet/tcp', :name => 'ssh', :number => '23')


+ res[:number].should == '23'
+ res[:name].should == 'ssh'

+ res[:protocol].should == :tcp
+ end
+


+ it "should not extract protocol from title if explicitly set" do

+ res = @class.new(:title => 'telnet/tcp', :protocol => :udp, :number => '23')
+ res[:number].should == '23'
+ res[:name].should == 'telnet'
+ res[:protocol].should == :udp
+ end
+


+ it "should not extract name and protocol from title when they are explicitly set" do

+ res = @class.new(:title => 'foo/udp', :name => 'bar', :protocol => :tcp, :number => '23')


+ res[:number].should == '23'
+ res[:name].should == 'bar'

+ res[:protocol].should == :tcp
+ end
+
+ end
+


+ describe "when syncing" do
+
+ it "should send the first value to the provider for number property" do
+ number = @class.attrclass(:number).new(:resource => @resource, :should => %w{100 200})
+ @provider.expects(:number=).with '100'
+ number.sync

+ end
+


+ it "should send the joined array to the provider for port_aliases property" do
+ port_aliases = @class.attrclass(:port_aliases).new(:resource => @resource, :should => %w{foo bar})
+ @provider.expects(:port_aliases=).with 'foo bar'
+ port_aliases.sync

+ end
+


+ it "should care about the order of port_aliases" do
+ port_aliases = @class.attrclass(:port_aliases).new(:resource => @resource, :should => %w{a z b})
+ port_aliases.insync?(%w{a z b}).should == true
+ port_aliases.insync?(%w{a b z}).should == false
+ port_aliases.insync?(%w{b a z}).should == false
+ port_aliases.insync?(%w{z a b}).should == false
+ port_aliases.insync?(%w{z b a}).should == false
+ port_aliases.insync?(%w{b z a}).should == false

+ end
+
+ end
+

+ describe "when comparing uniqueness_key of two ports" do

+


+ it "should be equal if name and protocol are the same" do
+ foo_tcp1 = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ foo_tcp2 = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ foo_tcp1.uniqueness_key.should == ['foo', :tcp ]
+ foo_tcp2.uniqueness_key.should == ['foo', :tcp ]
+ foo_tcp1.uniqueness_key.should == foo_tcp2.uniqueness_key

+ end
+


+ it "should not be equal if protocol differs" do
+ foo_tcp = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ foo_udp = @class.new(:name => "foo", :protocol => :udp, :number => '23')
+ foo_tcp.uniqueness_key.should == [ 'foo', :tcp ]
+ foo_udp.uniqueness_key.should == [ 'foo', :udp ]
+ foo_tcp.uniqueness_key.should_not == foo_udp.uniqueness_key

+ end
+


+ it "should not be equal if name differs" do
+ foo_tcp = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ bar_tcp = @class.new(:name => "bar", :protocol => :tcp, :number => '23')
+ foo_tcp.uniqueness_key.should == [ 'foo', :tcp ]
+ bar_tcp.uniqueness_key.should == [ 'bar', :tcp ]
+ foo_tcp.uniqueness_key.should_not == bar_tcp.uniqueness_key

+ end
+


+ it "should not be equal if both name and protocol differ" do
+ foo_tcp = @class.new(:name => "foo", :protocol => :tcp, :number => '23')
+ bar_udp = @class.new(:name => "bar", :protocol => :udp, :number => '23')
+ foo_tcp.uniqueness_key.should == [ 'foo', :tcp ]
+ bar_udp.uniqueness_key.should == [ 'bar', :udp ]
+ foo_tcp.uniqueness_key.should_not == bar_udp.uniqueness_key

+ end
+
+ end
+

+ describe "when adding resource to a catalog" do
+
+ it "should not allow two resources with the same name and protocol" do
+ res1 = @class.new(:name => "telnet", :protocol => :tcp, :number => '23')
+ res2 = @class.new(:name => "telnet", :protocol => :tcp, :number => '23')
+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should raise_error(Puppet::Resource::Catalog::DuplicateResourceError)

+ end
+


+ it "should allow two resources with different name and protocol" do
+ res1 = @class.new(:name => "telnet", :protocol => :tcp, :number => '23')
+ res2 = @class.new(:name => "git", :protocol => :tcp, :number => '9418')
+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should_not raise_error

+ end
+


+ it "should allow two resources with same name and different protocol" do

+ # I would like to have a gentitle method that would not automatically set
+ # title to resource[:name] but to uniqueness_key.join('/') or
+ # similar - stschulte
+ res1 = @class.new(:title => 'telnet/tcp', :name => 'telnet', :protocol => :tcp, :number => '23')
+ res2 = @class.new(:title => 'telnet/udp', :name => 'telnet', :protocol => :udp, :number => '23')


+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should_not raise_error

+ end
+


+ it "should allow two resources with the same protocol but different names" do

+ res1 = @class.new(:title => 'telnet/tcp', :name => 'telnet', :protocol => :tcp, :number => '23')
+ res2 = @class.new(:title => 'ssh/tcp', :name => 'ssh', :protocol => :tcp, :number => '23')


+ proc { @catalog.add_resource(res1) }.should_not raise_error
+ proc { @catalog.add_resource(res2) }.should_not raise_error

+ end
+
+ end
+

+end
--
1.7.4.1

Stefan Schulte

unread,
Mar 22, 2011, 6:35:12 PM3/22/11
to puppe...@googlegroups.com
Remove old tests for the old port type. The old port type was apparently
never finished and the tests were commented out anyways.

Signed-off-by: Stefan Schulte <stefan....@taunusstein.net>
---
Local-branch: feature/next/5660N

test/data/types/port/1 | 533 --
test/data/types/port/darwin |11866 -------------------------------------
test/ral/providers/port/parsed.rb | 232 -
test/ral/type/port.rb | 147 -
4 files changed, 0 insertions(+), 12778 deletions(-)
delete mode 100644 test/data/types/port/1
delete mode 100644 test/data/types/port/darwin
delete mode 100755 test/ral/providers/port/parsed.rb
delete mode 100755 test/ral/type/port.rb

diff --git a/test/data/types/port/1 b/test/data/types/port/1
deleted file mode 100644
index 47da837..0000000
--- a/test/data/types/port/1
+++ /dev/null
@@ -1,533 +0,0 @@
-# Network services, Internet style
-#
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, officially ports have two entries
-# even if the protocol doesn't support UDP operations.
-#
-# Updated from http://www.iana.org/assignments/port-numbers and other
-# sources like http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/services .
-# New ports will be added on request if they have been officially assigned
-# by IANA and used in the real-world or are needed by a debian package.
-# If you need a huge list of used numbers please install the nmap package.
-
-tcpmux 1/tcp # TCP port service multiplexer
-echo 7/tcp
-echo 7/udp
-discard 9/tcp sink null
-discard 9/udp sink null
-systat 11/tcp users
-daytime 13/tcp
-daytime 13/udp
-netstat 15/tcp
-qotd 17/tcp quote
-msp 18/tcp # message send protocol
-msp 18/udp
-chargen 19/tcp ttytst source
-chargen 19/udp ttytst source
-ftp-data 20/tcp
-ftp 21/tcp
-fsp 21/udp fspd
-ssh 22/tcp # SSH Remote Login Protocol
-ssh 22/udp
-telnet 23/tcp
-smtp 25/tcp mail
-time 37/tcp timserver
-time 37/udp timserver
-rlp 39/udp resource # resource location
-nameserver 42/tcp name # IEN 116
-whois 43/tcp nicname
-tacacs 49/tcp # Login Host Protocol (TACACS)
-tacacs 49/udp
-re-mail-ck 50/tcp # Remote Mail Checking Protocol
-re-mail-ck 50/udp
-domain 53/tcp nameserver # name-domain server
-domain 53/udp nameserver
-mtp 57/tcp # deprecated
-tacacs-ds 65/tcp # TACACS-Database Service
-tacacs-ds 65/udp
-bootps 67/tcp # BOOTP server
-bootps 67/udp
-bootpc 68/tcp # BOOTP client
-bootpc 68/udp
-tftp 69/udp
-gopher 70/tcp # Internet Gopher
-gopher 70/udp
-rje 77/tcp netrjs
-finger 79/tcp
-www 80/tcp http # WorldWideWeb HTTP
-www 80/udp # HyperText Transfer Protocol
-link 87/tcp ttylink
-kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5
-kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5
-supdup 95/tcp
-hostnames 101/tcp hostname # usually from sri-nic
-iso-tsap 102/tcp tsap # part of ISODE
-acr-nema 104/tcp dicom # Digital Imag. & Comm. 300
-acr-nema 104/udp dicom # Digital Imag. & Comm. 300
-csnet-ns 105/tcp cso-ns # also used by CSO name server
-csnet-ns 105/udp cso-ns
-rtelnet 107/tcp # Remote Telnet
-rtelnet 107/udp
-pop2 109/tcp postoffice pop-2 # POP version 2
-pop2 109/udp pop-2
-pop3 110/tcp pop-3 # POP version 3
-pop3 110/udp pop-3
-sunrpc 111/tcp portmapper # RPC 4.0 portmapper
-sunrpc 111/udp portmapper
-auth 113/tcp authentication tap ident
-sftp 115/tcp
-uucp-path 117/tcp
-nntp 119/tcp readnews untp # USENET News Transfer Protocol
-ntp 123/tcp
-ntp 123/udp # Network Time Protocol
-pwdgen 129/tcp # PWDGEN service
-pwdgen 129/udp # PWDGEN service
-loc-srv 135/tcp epmap # Location Service
-loc-srv 135/udp epmap
-netbios-ns 137/tcp # NETBIOS Name Service
-netbios-ns 137/udp
-netbios-dgm 138/tcp # NETBIOS Datagram Service
-netbios-dgm 138/udp
-netbios-ssn 139/tcp # NETBIOS session service
-netbios-ssn 139/udp
-imap2 143/tcp imap # Interim Mail Access P 2 and 4
-imap2 143/udp imap
-snmp 161/tcp # Simple Net Mgmt Protocol
-snmp 161/udp # Simple Net Mgmt Protocol
-snmp-trap 162/tcp snmptrap # Traps for SNMP
-snmp-trap 162/udp snmptrap # Traps for SNMP
-cmip-man 163/tcp # ISO mgmt over IP (CMOT)
-cmip-man 163/udp
-cmip-agent 164/tcp
-cmip-agent 164/udp
-mailq 174/tcp # Mailer transport queue for Zmailer
-mailq 174/udp # Mailer transport queue for Zmailer
-xdmcp 177/tcp # X Display Mgr. Control Proto
-xdmcp 177/udp
-nextstep 178/tcp NeXTStep NextStep # NeXTStep window
-nextstep 178/udp NeXTStep NextStep # server
-bgp 179/tcp # Border Gateway Protocol
-bgp 179/udp
-prospero 191/tcp # Cliff Neuman's Prospero
-prospero 191/udp
-irc 194/tcp # Internet Relay Chat
-irc 194/udp
-smux 199/tcp # SNMP Unix Multiplexer
-smux 199/udp
-at-rtmp 201/tcp # AppleTalk routing
-at-rtmp 201/udp
-at-nbp 202/tcp # AppleTalk name binding
-at-nbp 202/udp
-at-echo 204/tcp # AppleTalk echo
-at-echo 204/udp
-at-zis 206/tcp # AppleTalk zone information
-at-zis 206/udp
-qmtp 209/tcp # Quick Mail Transfer Protocol
-qmtp 209/udp # Quick Mail Transfer Protocol
-z3950 210/tcp wais # NISO Z39.50 database
-z3950 210/udp wais
-ipx 213/tcp # IPX
-ipx 213/udp
-imap3 220/tcp # Interactive Mail Access
-imap3 220/udp # Protocol v3
-pawserv 345/tcp # Perf Analysis Workbench
-pawserv 345/udp
-zserv 346/tcp # Zebra server
-zserv 346/udp
-fatserv 347/tcp # Fatmen Server
-fatserv 347/udp
-rpc2portmap 369/tcp
-rpc2portmap 369/udp # Coda portmapper
-codaauth2 370/tcp
-codaauth2 370/udp # Coda authentication server
-clearcase 371/tcp Clearcase
-clearcase 371/udp Clearcase
-ulistserv 372/tcp # UNIX Listserv
-ulistserv 372/udp
-ldap 389/tcp # Lightweight Directory Access Protocol
-ldap 389/udp
-imsp 406/tcp # Interactive Mail Support Protocol
-imsp 406/udp
-https 443/tcp # http protocol over TLS/SSL
-https 443/udp
-snpp 444/tcp # Simple Network Paging Protocol
-snpp 444/udp
-microsoft-ds 445/tcp # Microsoft Naked CIFS
-microsoft-ds 445/udp
-saft 487/tcp # Simple Asynchronous File Transfer
-saft 487/udp
-isakmp 500/tcp # IPsec - Internet Security Association
-isakmp 500/udp # and Key Management Protocol
-rtsp 554/tcp # Real Time Stream Control Protocol
-rtsp 554/udp # Real Time Stream Control Protocol
-nqs 607/tcp # Network Queuing system
-nqs 607/udp
-npmp-local 610/tcp dqs313_qmaster # npmp-local / DQS
-npmp-local 610/udp dqs313_qmaster
-npmp-gui 611/tcp dqs313_execd # npmp-gui / DQS
-npmp-gui 611/udp dqs313_execd
-hmmp-ind 612/tcp dqs313_intercell # HMMP Indication / DQS
-hmmp-ind 612/udp dqs313_intercell
-ipp 631/tcp # Internet Printing Protocol
-ipp 631/udp
-#
-# UNIX specific services
-#
-exec 512/tcp
-biff 512/udp comsat
-login 513/tcp
-who 513/udp whod
-shell 514/tcp cmd # no passwords used
-syslog 514/udp
-printer 515/tcp spooler # line printer spooler
-talk 517/udp
-ntalk 518/udp
-route 520/udp router routed # RIP
-timed 525/udp timeserver
-tempo 526/tcp newdate
-courier 530/tcp rpc
-conference 531/tcp chat
-netnews 532/tcp readnews
-netwall 533/udp # for emergency broadcasts
-gdomap 538/tcp # GNUstep distributed objects
-gdomap 538/udp
-uucp 540/tcp uucpd # uucp daemon
-klogin 543/tcp # Kerberized `rlogin' (v5)
-kshell 544/tcp krcmd # Kerberized `rsh' (v5)
-afpovertcp 548/tcp # AFP over TCP
-afpovertcp 548/udp
-remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem
-nntps 563/tcp snntp # NNTP over SSL
-nntps 563/udp snntp
-submission 587/tcp # Submission [RFC2476]
-submission 587/udp
-ldaps 636/tcp # LDAP over SSL
-ldaps 636/udp
-tinc 655/tcp # tinc control port
-tinc 655/udp
-silc 706/tcp
-silc 706/udp
-kerberos-adm 749/tcp # Kerberos `kadmin' (v5)
-#
-webster 765/tcp # Network dictionary
-webster 765/udp
-rsync 873/tcp
-rsync 873/udp
-ftps-data 989/tcp # FTP over SSL (data)
-ftps 990/tcp
-telnets 992/tcp # Telnet over SSL
-telnets 992/udp
-imaps 993/tcp # IMAP over SSL
-imaps 993/udp
-ircs 994/tcp # IRC over SSL
-ircs 994/udp
-pop3s 995/tcp # POP-3 over SSL
-pop3s 995/udp
-#
-# From ``Assigned Numbers'':
-#
-#> The Registered Ports are not controlled by the IANA and on most systems
-#> can be used by ordinary user processes or programs executed by ordinary
-#> users.
-#
-#> Ports are used in the TCP [45,106] to name the ends of logical
-#> connections which carry long term conversations. For the purpose of
-#> providing services to unknown callers, a service contact port is
-#> defined. This list specifies the port used by the server process as its
-#> contact port. While the IANA can not control uses of these ports it
-#> does register or list uses of these ports as a convienence to the
-#> community.
-#
-socks 1080/tcp # socks proxy server
-socks 1080/udp
-proofd 1093/tcp
-proofd 1093/udp
-rootd 1094/tcp
-rootd 1094/udp
-openvpn 1194/tcp
-openvpn 1194/udp
-rmiregistry 1099/tcp # Java RMI Registry
-rmiregistry 1099/udp
-kazaa 1214/tcp
-kazaa 1214/udp
-nessus 1241/tcp # Nessus vulnerability
-nessus 1241/udp # assessment scanner
-lotusnote 1352/tcp lotusnotes # Lotus Note
-lotusnote 1352/udp lotusnotes
-ms-sql-s 1433/tcp # Microsoft SQL Server
-ms-sql-s 1433/udp
-ms-sql-m 1434/tcp # Microsoft SQL Monitor
-ms-sql-m 1434/udp
-ingreslock 1524/tcp
-ingreslock 1524/udp
-prospero-np 1525/tcp # Prospero non-privileged
-prospero-np 1525/udp
-datametrics 1645/tcp old-radius
-datametrics 1645/udp old-radius
-sa-msg-port 1646/tcp old-radacct
-sa-msg-port 1646/udp old-radacct
-kermit 1649/tcp
-kermit 1649/udp
-l2f 1701/tcp l2tp
-l2f 1701/udp l2tp
-radius 1812/tcp
-radius 1812/udp
-radius-acct 1813/tcp radacct # Radius Accounting
-radius-acct 1813/udp radacct
-unix-status 1957/tcp # remstats unix-status server
-log-server 1958/tcp # remstats log server
-remoteping 1959/tcp # remstats remoteping server
-rtcm-sc104 2101/tcp # RTCM SC-104 IANA 1/29/99
-rtcm-sc104 2101/udp
-cvspserver 2401/tcp # CVS client/server operations
-cvspserver 2401/udp
-venus 2430/tcp # codacon port
-venus 2430/udp # Venus callback/wbc interface
-venus-se 2431/tcp # tcp side effects
-venus-se 2431/udp # udp sftp side effect
-codasrv 2432/tcp # not used
-codasrv 2432/udp # server port
-codasrv-se 2433/tcp # tcp side effects
-codasrv-se 2433/udp # udp sftp side effect
-mon 2583/tcp # MON
-mon 2583/udp
-dict 2628/tcp # Dictionary server
-dict 2628/udp
-gpsd 2947/tcp
-gpsd 2947/udp
-gds_db 3050/tcp # InterBase server
-gds_db 3050/udp
-icpv2 3130/tcp icp # Internet Cache Protocol
-icpv2 3130/udp icp
-mysql 3306/tcp
-mysql 3306/udp
-nut 3493/tcp # Network UPS Tools
-nut 3493/udp
-distcc 3632/tcp # distributed compiler
-distcc 3632/udp
-daap 3689/tcp # Digital Audio Access Protocol
-daap 3689/udp
-svn 3690/tcp subversion # Subversion protocol
-svn 3690/udp subversion
-iax 4569/tcp # Inter-Asterisk eXchange
-iax 4569/udp
-radmin-port 4899/tcp # RAdmin Port
-radmin-port 4899/udp
-rfe 5002/udp # Radio Free Ethernet
-rfe 5002/tcp
-sip 5060/tcp # Session Initiation Protocol
-sip 5060/udp
-sip-tls 5061/tcp
-sip-tls 5061/udp
-xmpp-client 5222/tcp jabber-client # Jabber Client Connection
-xmpp-client 5222/udp jabber-client
-xmpp-server 5269/tcp jabber-server # Jabber Server Connection
-xmpp-server 5269/udp jabber-server
-cfengine 5308/tcp
-cfengine 5308/udp
-postgresql 5432/tcp postgres # PostgreSQL Database
-postgresql 5432/udp postgres
-x11 6000/tcp x11-0 # X Window System
-x11 6000/udp x11-0
-x11-1 6001/tcp
-x11-1 6001/udp
-x11-2 6002/tcp
-x11-2 6002/udp
-x11-3 6003/tcp
-x11-3 6003/udp
-x11-4 6004/tcp
-x11-4 6004/udp
-x11-5 6005/tcp
-x11-5 6005/udp
-x11-6 6006/tcp
-x11-6 6006/udp
-x11-7 6007/tcp
-x11-7 6007/udp
-gnutella-svc 6346/tcp # gnutella
-gnutella-svc 6346/udp
-gnutella-rtr 6347/tcp # gnutella
-gnutella-rtr 6347/udp
-afs3-fileserver 7000/tcp bbs # file server itself
-afs3-fileserver 7000/udp bbs
-afs3-callback 7001/tcp # callbacks to cache managers
-afs3-callback 7001/udp
-afs3-prserver 7002/tcp # users & groups database
-afs3-prserver 7002/udp
-afs3-vlserver 7003/tcp # volume location database
-afs3-vlserver 7003/udp
-afs3-kaserver 7004/tcp # AFS/Kerberos authentication
-afs3-kaserver 7004/udp
-afs3-volser 7005/tcp # volume managment server
-afs3-volser 7005/udp
-afs3-errors 7006/tcp # error interpretation service
-afs3-errors 7006/udp
-afs3-bos 7007/tcp # basic overseer process
-afs3-bos 7007/udp
-afs3-update 7008/tcp # server-to-server updater
-afs3-update 7008/udp
-afs3-rmtsys 7009/tcp # remote cache manager service
-afs3-rmtsys 7009/udp
-font-service 7100/tcp xfs # X Font Service
-font-service 7100/udp xfs
-bacula-dir 9101/tcp # Bacula Director
-bacula-dir 9101/udp
-bacula-fd 9102/tcp # Bacula File Daemon
-bacula-fd 9102/udp
-bacula-sd 9103/tcp # Bacula Storage Daemon
-bacula-sd 9103/udp
-amanda 10080/tcp # amanda backup services
-amanda 10080/udp
-hkp 11371/tcp # OpenPGP HTTP Keyserver
-hkp 11371/udp # OpenPGP HTTP Keyserver
-bprd 13720/tcp # VERITAS NetBackup
-bprd 13720/udp
-bpdbm 13721/tcp # VERITAS NetBackup
-bpdbm 13721/udp
-bpjava-msvc 13722/tcp # BP Java MSVC Protocol
-bpjava-msvc 13722/udp
-vnetd 13724/tcp # Veritas Network Utility
-vnetd 13724/udp
-bpcd 13782/tcp # VERITAS NetBackup
-bpcd 13782/udp
-vopied 13783/tcp # VERITAS NetBackup
-vopied 13783/udp
-wnn6 22273/tcp # wnn6
-wnn6 22273/udp
-
-#
-# Datagram Delivery Protocol services
-#
-rtmp 1/ddp # Routing Table Maintenance Protocol
-nbp 2/ddp # Name Binding Protocol
-echo 4/ddp # AppleTalk Echo Protocol
-zip 6/ddp # Zone Information Protocol
-
-#=========================================================================
-# The remaining port numbers are not as allocated by IANA.
-#=========================================================================
-
-# Kerberos (Project Athena/MIT) services
-# Note that these are for Kerberos v4, and are unofficial. Sites running
-# v4 should uncomment these and comment out the v5 entries above.
-#
-kerberos4 750/udp kerberos-iv kdc # Kerberos (server)
-kerberos4 750/tcp kerberos-iv kdc
-kerberos_master 751/udp # Kerberos authentication
-kerberos_master 751/tcp
-passwd_server 752/udp # Kerberos passwd server
-krb_prop 754/tcp krb5_prop hprop # Kerberos slave propagation
-krbupdate 760/tcp kreg # Kerberos registration
-kpasswd 761/tcp kpwd # Kerberos "passwd"
-swat 901/tcp # swat
-kpop 1109/tcp # Pop with Kerberos
-knetd 2053/tcp # Kerberos de-multiplexor
-zephyr-srv 2102/udp # Zephyr server
-zephyr-clt 2103/udp # Zephyr serv-hm connection
-zephyr-hm 2104/udp # Zephyr hostmanager
-eklogin 2105/tcp # Kerberos encrypted rlogin
-# Hmmm. Are we using Kv4 or Kv5 now? Worrying.
-# The following is probably Kerberos v5 --- a...@debian.org (11/02/2000)
-kx 2111/tcp # X over Kerberos
-iprop 2121/tcp # incremental propagation
-#
-# Unofficial but necessary (for NetBSD) services
-#
-supfilesrv 871/tcp # SUP server
-supfiledbg 1127/tcp # SUP debugging
-
-#
-# Services added for the Debian GNU/Linux distribution
-#
-linuxconf 98/tcp # LinuxConf
-poppassd 106/tcp # Eudora
-poppassd 106/udp
-ssmtp 465/tcp smtps # SMTP over SSL
-moira_db 775/tcp # Moira database
-moira_update 777/tcp # Moira update protocol
-moira_ureg 779/udp # Moira user registration
-spamd 783/tcp # spamassassin daemon
-omirr 808/tcp omirrd # online mirror
-omirr 808/udp omirrd
-customs 1001/tcp # pmake customs server
-customs 1001/udp
-skkserv 1178/tcp # skk jisho server port
-predict 1210/udp # predict -- satellite tracking
-rmtcfg 1236/tcp # Gracilis Packeten remote config server
-wipld 1300/tcp # Wipl network monitor
-xtel 1313/tcp # french minitel
-xtelw 1314/tcp # french minitel
-support 1529/tcp # GNATS
-sieve 2000/tcp # Sieve mail filter daemon
-cfinger 2003/tcp # GNU Finger
-ndtp 2010/tcp # Network dictionary transfer protocol
-frox 2121/tcp # frox: caching ftp proxy
-ninstall 2150/tcp # ninstall service
-ninstall 2150/udp
-zebrasrv 2600/tcp # zebra service
-zebra 2601/tcp # zebra vty
-ripd 2602/tcp # ripd vty (zebra)
-ripngd 2603/tcp # ripngd vty (zebra)
-ospfd 2604/tcp # ospfd vty (zebra)
-bgpd 2605/tcp # bgpd vty (zebra)
-ospf6d 2606/tcp # ospf6d vty (zebra)
-ospfapi 2607/tcp # OSPF-API
-isisd 2608/tcp # ISISd vty (zebra)
-afbackup 2988/tcp # Afbackup system
-afbackup 2988/udp
-afmbackup 2989/tcp # Afmbackup system
-afmbackup 2989/udp
-xtell 4224/tcp # xtell server
-fax 4557/tcp # FAX transmission service (old)
-hylafax 4559/tcp # HylaFAX client-server protocol (new)
-distmp3 4600/tcp # distmp3host daemon
-munin 4949/tcp lrrd # Munin
-enbd-cstatd 5051/tcp # ENBD client statd
-enbd-sstatd 5052/tcp # ENBD server statd
-pcrd 5151/tcp # PCR-1000 Daemon
-noclog 5354/tcp # noclogd with TCP (nocol)
-noclog 5354/udp # noclogd with UDP (nocol)
-hostmon 5355/tcp # hostmon uses TCP (nocol)
-hostmon 5355/udp # hostmon uses UDP (nocol)
-rplay 5555/udp # RPlay audio service
-rplay 5555/tcp
-rptp 5556/udp # Remote Play Transfer Protocol
-rptp 5556/tcp
-nsca 5667/tcp # Nagios Agent - NSCA
-mrtd 5674/tcp # MRT Routing Daemon
-bgpsim 5675/tcp # MRT Routing Simulator
-canna 5680/tcp # cannaserver
-sane-port 6566/tcp sane saned # SANE network scanner daemon
-ircd 6667/tcp # Internet Relay Chat
-zope-ftp 8021/tcp # zope management by ftp
-webcache 8080/tcp # WWW caching service
-tproxy 8081/tcp # Transparent Proxy
-omniorb 8088/tcp # OmniORB
-omniorb 8088/udp
-clc-build-daemon 8990/tcp # Common lisp build daemon
-xinetd 9098/tcp
-mandelspawn 9359/udp mandelbrot # network mandelbrot
-zope 9673/tcp # zope server
-kamanda 10081/tcp # amanda backup services (Kerberos)
-kamanda 10081/udp
-amandaidx 10082/tcp # amanda backup services
-amidxtape 10083/tcp # amanda backup services
-smsqp 11201/tcp # Alamin SMS gateway
-smsqp 11201/udp
-xpilot 15345/tcp # XPilot Contact Port
-xpilot 15345/udp
-sgi-cmsd 17001/udp # Cluster membership services daemon
-sgi-crsd 17002/udp
-sgi-gcd 17003/udp # SGI Group membership daemon
-sgi-cad 17004/tcp # Cluster Admin daemon
-isdnlog 20011/tcp # isdn logging system
-isdnlog 20011/udp
-vboxd 20012/tcp # voice box system
-vboxd 20012/udp
-binkp 24554/tcp # binkp fidonet protocol
-asp 27374/tcp # Address Search Protocol
-asp 27374/udp
-dircproxy 57000/tcp # Detachable IRC Proxy
-tfido 60177/tcp # fidonet EMSI over telnet
-fido 60179/tcp # fidonet EMSI over TCP
-
-# Local services
diff --git a/test/data/types/port/darwin b/test/data/types/port/darwin
deleted file mode 100644
index 3d27dd5..0000000
--- a/test/data/types/port/darwin
+++ /dev/null
@@ -1,11866 +0,0 @@
-#
-# Network services, Internet style
-#
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, most entries here have two entries
-# even if the protocol doesn't support UDP operations.
-#
-# The latest IANA port assignments can be gotten from
-#
-# http://www.iana.org/assignments/port-numbers
-#
-# The Well Known Ports are those from 0 through 1023.
-# The Registered Ports are those from 1024 through 49151
-# The Dynamic and/or Private Ports are those from 49152 through 65535
-#
-# $FreeBSD: src/etc/services,v 1.89 2002/12/17 23:59:10 eric Exp $
-# From: @(#)services 5.8 (Berkeley) 5/9/91
-#
-# WELL KNOWN PORT NUMBERS
-#
-rtmp 1/ddp #Routing Table Maintenance Protocol
-tcpmux 1/udp # TCP Port Service Multiplexer
-tcpmux 1/tcp # TCP Port Service Multiplexer
-# Mark Lottor <M...@nisc.sri.com>
-nbp 2/ddp #Name Binding Protocol
-compressnet 2/udp # Management Utility
-compressnet 2/tcp # Management Utility
-compressnet 3/udp # Compression Process
-compressnet 3/tcp # Compression Process
-# Bernie Volz <VO...@PROCESS.COM>
-echo 4/ddp #AppleTalk Echo Protocol
-# 4/tcp Unassigned
-# 4/udp Unassigned
-rje 5/udp # Remote Job Entry
-rje 5/tcp # Remote Job Entry
-# Jon Postel <pos...@isi.edu>
-zip 6/ddp #Zone Information Protocol
-# 6/tcp Unassigned
-# 6/udp Unassigned
-echo 7/udp # Echo
-echo 7/tcp # Echo
-# Jon Postel <pos...@isi.edu>
-# 8/tcp Unassigned
-# 8/udp Unassigned
-discard 9/udp # Discard
-discard 9/tcp # Discard
-# Jon Postel <pos...@isi.edu>
-# 10/tcp Unassigned
-# 10/udp Unassigned
-systat 11/udp # Active Users
-systat 11/tcp # Active Users
-# Jon Postel <pos...@isi.edu>
-# 12/tcp Unassigned
-# 12/udp Unassigned
-daytime 13/udp # Daytime (RFC 867)
-daytime 13/tcp # Daytime (RFC 867)
-# Jon Postel <pos...@isi.edu>
-# 14/tcp Unassigned
-# 14/udp Unassigned
-# 15/tcp Unassigned [was netstat]
-# 15/udp Unassigned
-# 16/tcp Unassigned
-# 16/udp Unassigned
-qotd 17/udp # Quote of the Day
-qotd 17/tcp # Quote of the Day
-# Jon Postel <pos...@isi.edu>
-msp 18/udp # Message Send Protocol
-msp 18/tcp # Message Send Protocol
-# Rina Nethaniel <---none--->
-chargen 19/udp # Character Generator
-chargen 19/tcp # Character Generator
-ftp-data 20/udp # File Transfer [Default Data]
-ftp-data 20/tcp # File Transfer [Default Data]
-ftp 21/udp # File Transfer [Control]
-ftp 21/tcp # File Transfer [Control]
-# Jon Postel <pos...@isi.edu>
-ssh 22/udp # SSH Remote Login Protocol
-ssh 22/tcp # SSH Remote Login Protocol
-# Tatu Ylonen <y...@cs.hut.fi>
-telnet 23/udp # Telnet
-telnet 23/tcp # Telnet
-# Jon Postel <pos...@isi.edu>
- 24/udp # any private mail system
- 24/tcp # any private mail system
-# Rick Adams <ri...@UUNET.UU.NET>
-smtp 25/udp # Simple Mail Transfer
-smtp 25/tcp # Simple Mail Transfer
-# Jon Postel <pos...@isi.edu>
-# 26/tcp Unassigned
-# 26/udp Unassigned
-nsw-fe 27/udp # NSW User System FE
-nsw-fe 27/tcp # NSW User System FE
-# Robert Thomas <BTh...@F.BBN.COM>
-# 28/tcp Unassigned
-# 28/udp Unassigned
-msg-icp 29/udp # MSG ICP
-msg-icp 29/tcp # MSG ICP
-# Robert Thomas <BTh...@F.BBN.COM>
-# 30/tcp Unassigned
-# 30/udp Unassigned
-msg-auth 31/udp # MSG Authentication
-msg-auth 31/tcp # MSG Authentication
-# Robert Thomas <BTh...@F.BBN.COM>
-# 32/tcp Unassigned
-# 32/udp Unassigned
-dsp 33/udp # Display Support Protocol
-dsp 33/tcp # Display Support Protocol
-# Ed Cain <ca...@edn-unix.dca.mil>
-# 34/tcp Unassigned
-# 34/udp Unassigned
- 35/udp # any private printer server
- 35/tcp # any private printer server
-# Jon Postel <pos...@isi.edu>
-# 36/tcp Unassigned
-# 36/udp Unassigned
-time 37/udp # Time
-time 37/tcp # Time
-# Jon Postel <pos...@isi.edu>
-rap 38/udp # Route Access Protocol
-rap 38/tcp # Route Access Protocol
-# Robert Ullmann <ar...@world.std.com>
-rlp 39/udp # Resource Location Protocol
-rlp 39/tcp # Resource Location Protocol
-# Mike Accetta <MIKE.A...@CMU-CS-A.EDU>
-# 40/tcp Unassigned
-# 40/udp Unassigned
-graphics 41/udp # Graphics
-graphics 41/tcp # Graphics
-name 42/udp nameserver # Host Name Server
-name 42/tcp nameserver # Host Name Server
-nicname 43/udp # Who Is
-nicname 43/tcp # Who Is
-mpm-flags 44/udp # MPM FLAGS Protocol
-mpm-flags 44/tcp # MPM FLAGS Protocol
-mpm 45/udp # Message Processing Module [recv]
-mpm 45/tcp # Message Processing Module [recv]
-mpm-snd 46/udp # MPM [default send]
-mpm-snd 46/tcp # MPM [default send]
-# Jon Postel <pos...@isi.edu>
-ni-ftp 47/udp # NI FTP
-ni-ftp 47/tcp # NI FTP
-# Steve Kille <S.K...@isode.com>
-auditd 48/udp # Digital Audit Daemon
-auditd 48/tcp # Digital Audit Daemon
-# Larry Scott <sc...@zk3.dec.com>
-tacacs 49/udp # Login Host Protocol (TACACS)
-tacacs 49/tcp # Login Host Protocol (TACACS)
-# Pieter Ditmars <pdit...@BBN.COM>
-re-mail-ck 50/udp # Remote Mail Checking Protocol
-re-mail-ck 50/tcp # Remote Mail Checking Protocol
-# Steve Dorner <s-do...@UIUC.EDU>
-la-maint 51/udp # IMP Logical Address Maintenance
-la-maint 51/tcp # IMP Logical Address Maintenance
-# Andy Malis <mal...@timeplex.com>
-xns-time 52/udp # XNS Time Protocol
-xns-time 52/tcp # XNS Time Protocol
-# Susie Armstrong <Armstrong.wbst128@XEROX>
-domain 53/udp # Domain Name Server
-domain 53/tcp # Domain Name Server
-# Paul Mockapetris <P...@ISI.EDU>
-xns-ch 54/udp # XNS Clearinghouse
-xns-ch 54/tcp # XNS Clearinghouse
-# Susie Armstrong <Armstrong.wbst128@XEROX>
-isi-gl 55/udp # ISI Graphics Language
-isi-gl 55/tcp # ISI Graphics Language
-xns-auth 56/udp # XNS Authentication
-xns-auth 56/tcp # XNS Authentication
-# Susie Armstrong <Armstrong.wbst128@XEROX>
- 57/udp # any private terminal access
- 57/tcp # any private terminal access
-# Jon Postel <pos...@isi.edu>
-xns-mail 58/udp # XNS Mail
-xns-mail 58/tcp # XNS Mail
-# Susie Armstrong <Armstrong.wbst128@XEROX>
- 59/udp # any private file service
- 59/tcp # any private file service
-# Jon Postel <pos...@isi.edu>
- 60/udp # Unassigned
- 60/tcp # Unassigned
-ni-mail 61/udp # NI MAIL
-ni-mail 61/tcp # NI MAIL
-# Steve Kille <S.K...@isode.com>
-acas 62/udp # ACA Services
-acas 62/tcp # ACA Services
-# E. Wald <ew...@via.enet.dec.com>
-whois++ 63/udp # whois++
-whois++ 63/tcp # whois++
-# Rickard Schoultz <scho...@sunet.se>
-covia 64/udp # Communications Integrator (CI)
-covia 64/tcp # Communications Integrator (CI)
-# Dan Smith <dan....@den.galileo.com>
-tacacs-ds 65/udp # TACACS-Database Service
-tacacs-ds 65/tcp # TACACS-Database Service
-# Kathy Huber <khu...@bbn.com>
-sql*net 66/udp # Oracle SQL*NET
-sql*net 66/tcp # Oracle SQL*NET
-# Jack Haverty <jhav...@ORACLE.COM>
-bootps 67/udp # Bootstrap Protocol Server
-bootps 67/tcp # Bootstrap Protocol Server
-bootpc 68/udp # Bootstrap Protocol Client
-bootpc 68/tcp # Bootstrap Protocol Client
-# Bill Croft <Cr...@SUMEX-AIM.STANFORD.EDU>
-tftp 69/udp # Trivial File Transfer
-tftp 69/tcp # Trivial File Transfer
-# David Clark <d...@LCS.MIT.EDU>
-gopher 70/udp # Gopher
-gopher 70/tcp # Gopher
-# Mark McCahill <m...@boombox.micro.umn.edu>
-netrjs-1 71/udp # Remote Job Service
-netrjs-1 71/tcp # Remote Job Service
-netrjs-2 72/udp # Remote Job Service
-netrjs-2 72/tcp # Remote Job Service
-netrjs-3 73/udp # Remote Job Service
-netrjs-3 73/tcp # Remote Job Service
-netrjs-4 74/udp # Remote Job Service
-netrjs-4 74/tcp # Remote Job Service
-# Bob Braden <Bra...@ISI.EDU>
- 75/udp # any private dial out service
- 75/tcp # any private dial out service
-# Jon Postel <pos...@isi.edu>
-deos 76/udp # Distributed External Object Store
-deos 76/tcp # Distributed External Object Store
-# Robert Ullmann <ar...@world.std.com>
- 77/udp # any private RJE service
- 77/tcp # any private RJE service
-# Jon Postel <pos...@isi.edu>
-vettcp 78/udp # vettcp
-vettcp 78/tcp # vettcp
-# Christopher Leong <le...@kolmod.mlo.dec.com>
-finger 79/udp # Finger
-finger 79/tcp # Finger
-# David Zimmerman <d...@RUTGERS.EDU>
-http 80/udp www www-http # World Wide Web HTTP
-http 80/tcp www www-http # World Wide Web HTTP
-# Tim Berners-Lee <ti...@W3.org>
-hosts2-ns 81/udp # HOSTS2 Name Server
-hosts2-ns 81/tcp # HOSTS2 Name Server
-# Earl Killian <E...@MORDOR.S1.GOV>
-xfer 82/udp # XFER Utility
-xfer 82/tcp # XFER Utility
-# Thomas M. Smith <Thomas....@lmco.com>
-mit-ml-dev 83/udp # MIT ML Device
-mit-ml-dev 83/tcp # MIT ML Device
-# David Reed <--none--->
-ctf 84/udp # Common Trace Facility
-ctf 84/tcp # Common Trace Facility
-# Hugh Thomas <tho...@oils.enet.dec.com>
-mit-ml-dev 85/udp # MIT ML Device
-mit-ml-dev 85/tcp # MIT ML Device
-# David Reed <--none--->
-mfcobol 86/udp # Micro Focus Cobol
-mfcobol 86/tcp # Micro Focus Cobol
-# Simon Edwards <--none--->
- 87/udp # any private terminal link
- 87/tcp # any private terminal link
-# Jon Postel <pos...@isi.edu>
-kerberos 88/udp # Kerberos
-kerberos 88/tcp # Kerberos
-# B. Clifford Neuman <b...@isi.edu>
-su-mit-tg 89/udp # SU/MIT Telnet Gateway
-su-mit-tg 89/tcp # SU/MIT Telnet Gateway
-# Mark Crispin <M...@PANDA.COM>
-########### PORT 90 also being used unofficially by Pointcast #########
-dnsix 90/udp # DNSIX Securit Attribute Token Map
-dnsix 90/tcp # DNSIX Securit Attribute Token Map
-# Charles Watt <wa...@sware.com>
-mit-dov 91/udp # MIT Dover Spooler
-mit-dov 91/tcp # MIT Dover Spooler
-# Eliot Moss <E...@XX.LCS.MIT.EDU>
-npp 92/udp # Network Printing Protocol
-npp 92/tcp # Network Printing Protocol
-# Louis Mamakos <lo...@sayshell.umd.edu>
-dcp 93/udp # Device Control Protocol
-dcp 93/tcp # Device Control Protocol
-# Daniel Tappan <Tap...@BBN.COM>
-objcall 94/udp # Tivoli Object Dispatcher
-objcall 94/tcp # Tivoli Object Dispatcher
-# Tom Bereiter <--none--->
-supdup 95/udp # SUPDUP
-supdup 95/tcp # SUPDUP
-# Mark Crispin <M...@PANDA.COM>
-dixie 96/udp # DIXIE Protocol Specification
-dixie 96/tcp # DIXIE Protocol Specification
-# Tim Howes <Tim....@terminator.cc.umich.edu>
-swift-rvf 97/udp # Swift Remote Virtural File Protocol
-swift-rvf 97/tcp # Swift Remote Virtural File Protocol
-# Maurice R. Turcotte
-# <mailrus!uflorida!rm1!dnmrt%rm...@uunet.UU.NET>
-tacnews 98/udp # TAC News
-tacnews 98/tcp # TAC News
-# Jon Postel <pos...@isi.edu>
-metagram 99/udp # Metagram Relay
-metagram 99/tcp # Metagram Relay
-# Geoff Goodfellow <Ge...@FERNWOOD.MPK.CA.US>
-newacct 100/tcp # [unauthorized use]
-hostname 101/udp # NIC Host Name Server
-hostname 101/tcp # NIC Host Name Server
-# Jon Postel <pos...@isi.edu>
-iso-tsap 102/udp # ISO-TSAP Class 0
-iso-tsap 102/tcp # ISO-TSAP Class 0
-# Marshall Rose <mr...@dbc.mtview.ca.us>
-gppitnp 103/udp # Genesis Point-to-Point Trans Net
-gppitnp 103/tcp # Genesis Point-to-Point Trans Net
-acr-nema 104/udp # ACR-NEMA Digital Imag. & Comm. 300
-acr-nema 104/tcp # ACR-NEMA Digital Imag. & Comm. 300
-# Patrick McNamee <--none--->
-cso 105/udp # CCSO name server protocol
-cso 105/tcp # CCSO name server protocol
-# Martin Hamilton <mar...@mrrl.lut.as.uk>
-csnet-ns 105/udp # Mailbox Name Nameserver
-csnet-ns 105/tcp # Mailbox Name Nameserver
-# Marvin Solomon <sol...@CS.WISC.EDU>
-3com-tsmux 106/udp # 3COM-TSMUX
-3com-tsmux 106/tcp # 3COM-TSMUX
-# Jeremy Siegel <j...@NSD.3Com.COM>
-########## 106 Unauthorized use by insecure poppassd protocol
-rtelnet 107/udp # Remote Telnet Service
-rtelnet 107/tcp # Remote Telnet Service
-# Jon Postel <pos...@isi.edu>
-snagas 108/udp # SNA Gateway Access Server
-snagas 108/tcp # SNA Gateway Access Server
-# Kevin Murphy <mur...@sevens.lkg.dec.com>
-pop2 109/udp # Post Office Protocol - Version 2
-pop2 109/tcp # Post Office Protocol - Version 2
-# Joyce K. Reynolds <jk...@isi.edu>
-pop3 110/udp # Post Office Protocol - Version 3
-pop3 110/tcp # Post Office Protocol - Version 3
-# Marshall Rose <mr...@dbc.mtview.ca.us>
-sunrpc 111/udp # SUN Remote Procedure Call
-sunrpc 111/tcp # SUN Remote Procedure Call
-# Chuck McManis <cmcm...@freegate.net>
-mcidas 112/udp # McIDAS Data Transmission Protocol
-mcidas 112/tcp # McIDAS Data Transmission Protocol
-# Glenn Davis <sup...@unidata.ucar.edu>
-auth 113/udp # Authentication Service
-ident 113/tcp auth #
-# Mike St. Johns <stj...@arpa.mil>
-audionews 114/udp # Audio News Multicast
-audionews 114/tcp # Audio News Multicast
-# Martin Forssen <m...@dtek.chalmers.se>
-sftp 115/udp # Simple File Transfer Protocol
-sftp 115/tcp # Simple File Transfer Protocol
-# Mark Lottor <M...@nisc.sri.com>
-ansanotify 116/udp # ANSA REX Notify
-ansanotify 116/tcp # ANSA REX Notify
-# Nicola J. Howarth <n...@ansa.co.uk>
-uucp-path 117/udp # UUCP Path Service
-uucp-path 117/tcp # UUCP Path Service
-sqlserv 118/udp # SQL Services
-sqlserv 118/tcp # SQL Services
-# Larry Barnes <bar...@broke.enet.dec.com>
-nntp 119/udp # Network News Transfer Protocol
-nntp 119/tcp # Network News Transfer Protocol
-# Phil Lapsley <ph...@UCBARPA.BERKELEY.EDU>
-cfdptkt 120/udp # CFDPTKT
-cfdptkt 120/tcp # CFDPTKT
-# John Ioannidis <j...@close.cs.columbia.ed>
-erpc 121/udp # Encore Expedited Remote Pro.Call
-erpc 121/tcp # Encore Expedited Remote Pro.Call
-# Jack O'Neil <---none--->
-smakynet 122/udp # SMAKYNET
-smakynet 122/tcp # SMAKYNET
-# Pierre Arnaud <pierre...@iname.com>
-ntp 123/udp # Network Time Protocol
-ntp 123/tcp # Network Time Protocol
-# Dave Mills <Mi...@HUEY.UDEL.EDU>
-ansatrader 124/udp # ANSA REX Trader
-ansatrader 124/tcp # ANSA REX Trader
-# Nicola J. Howarth <n...@ansa.co.uk>
-locus-map 125/udp # Locus PC-Interface Net Map Ser
-locus-map 125/tcp # Locus PC-Interface Net Map Ser
-# Eric Peterson <lcc....@SEAS.UCLA.EDU>
-nxedit 126/udp # NXEdit
-nxedit 126/tcp # NXEdit
-# Don Payette <Don.P...@unisys.com>
-###########Port 126 Previously assigned to application below#######
-#unitary 126/tcp Unisys Unitary Login
-#unitary 126/udp Unisys Unitary Login
-# <fe...@kronos.nisd.cam.unisys.com>
-###########Port 126 Previously assigned to application above#######
-locus-con 127/udp # Locus PC-Interface Conn Server
-locus-con 127/tcp # Locus PC-Interface Conn Server
-# Eric Peterson <lcc....@SEAS.UCLA.EDU>
-gss-xlicen 128/udp # GSS X License Verification
-gss-xlicen 128/tcp # GSS X License Verification
-# John Light <jo...@gssc.gss.com>
-pwdgen 129/udp # Password Generator Protocol
-pwdgen 129/tcp # Password Generator Protocol
-# Frank J. Wacho <WAN...@WSMR-SIMTEL20.ARMY.MIL>
-cisco-fna 130/udp # cisco FNATIVE
-cisco-fna 130/tcp # cisco FNATIVE
-cisco-tna 131/udp # cisco TNATIVE
-cisco-tna 131/tcp # cisco TNATIVE
-cisco-sys 132/udp # cisco SYSMAINT
-cisco-sys 132/tcp # cisco SYSMAINT
-statsrv 133/udp # Statistics Service
-statsrv 133/tcp # Statistics Service
-# Dave Mills <Mi...@HUEY.UDEL.EDU>
-ingres-net 134/udp # INGRES-NET Service
-ingres-net 134/tcp # INGRES-NET Service
-# Mike Berrow <---none--->
-epmap 135/udp # DCE endpoint resolution
-epmap 135/tcp # DCE endpoint resolution
-# Joe Pato <pa...@apollo.hp.com>
-profile 136/udp # PROFILE Naming System
-profile 136/tcp # PROFILE Naming System
-# Larry Peterson <l...@ARIZONA.EDU>
-netbios-ns 137/udp # NETBIOS Name Service
-netbios-ns 137/tcp # NETBIOS Name Service
-netbios-dgm 138/udp # NETBIOS Datagram Service
-netbios-dgm 138/tcp # NETBIOS Datagram Service
-netbios-ssn 139/udp # NETBIOS Session Service
-netbios-ssn 139/tcp # NETBIOS Session Service
-# Jon Postel <pos...@isi.edu>
-emfis-data 140/udp # EMFIS Data Service
-emfis-data 140/tcp # EMFIS Data Service
-emfis-cntl 141/udp # EMFIS Control Service
-emfis-cntl 141/tcp # EMFIS Control Service
-# Gerd Beling <GBE...@ISI.EDU>
-bl-idm 142/udp # Britton-Lee IDM
-bl-idm 142/tcp # Britton-Lee IDM
-# Susie Snitzer <---none--->
-imap 143/udp # Internet Message Access Protocol
-imap 143/tcp # Internet Message Access Protocol
-# Mark Crispin <M...@CAC.Washington.EDU>
-uma 144/udp # Universal Management Architecture
-uma 144/tcp # Universal Management Architecture
-# Jay Whitney <j...@powercenter.com>
-uaac 145/udp # UAAC Protocol
-uaac 145/tcp # UAAC Protocol
-# David A. Gomberg <gom...@GATEWAY.MITRE.ORG>
-iso-tp0 146/udp # ISO-IP0
-iso-tp0 146/tcp # ISO-IP0
-iso-ip 147/udp # ISO-IP
-iso-ip 147/tcp # ISO-IP
-# Marshall Rose <mr...@dbc.mtview.ca.us>
-jargon 148/udp # Jargon
-jargon 148/tcp # Jargon
-# Bill Weinman <w...@bearnet.com>
-aed-512 149/udp # AED 512 Emulation Service
-aed-512 149/tcp # AED 512 Emulation Service
-# Albert G. Broscius <bros...@DSL.CIS.UPENN.EDU>
-sql-net 150/udp # SQL-NET
-sql-net 150/tcp # SQL-NET
-# Martin Picard <<---none--->
-hems 151/udp # HEMS
-hems 151/tcp # HEMS
-bftp 152/udp # Background File Transfer Program
-bftp 152/tcp # Background File Transfer Program
-# Annette DeSchon <DES...@ISI.EDU>
-sgmp 153/udp # SGMP
-sgmp 153/tcp # SGMP
-# Marty Schoffstahl <sch...@NISC.NYSER.NET>
-netsc-prod 154/udp # NETSC
-netsc-prod 154/tcp # NETSC
-netsc-dev 155/udp # NETSC
-netsc-dev 155/tcp # NETSC
-# Sergio Heker <he...@JVNCC.CSC.ORG>
-sqlsrv 156/udp # SQL Service
-sqlsrv 156/tcp # SQL Service
-# Craig Rogers <Rog...@ISI.EDU>
-knet-cmp 157/udp # KNET/VM Command/Message Protocol
-knet-cmp 157/tcp # KNET/VM Command/Message Protocol
-# Gary S. Malkin <GMA...@XYLOGICS.COM>
-pcmail-srv 158/udp # PCMail Server
-pcmail-srv 158/tcp # PCMail Server
-# Mark L. Lambert <ma...@PTT.LCS.MIT.EDU>
-nss-routing 159/udp # NSS-Routing
-nss-routing 159/tcp # NSS-Routing
-# Yakov Rekhter <Ya...@IBM.COM>
-sgmp-traps 160/udp # SGMP-TRAPS
-sgmp-traps 160/tcp # SGMP-TRAPS
-# Marty Schoffstahl <sch...@NISC.NYSER.NET>
-snmp 161/udp # SNMP
-snmp 161/tcp # SNMP
-snmptrap 162/udp # SNMPTRAP
-snmptrap 162/tcp # SNMPTRAP
-# Marshall Rose <mr...@dbc.mtview.ca.us>
-cmip-man 163/udp # CMIP/TCP Manager
-cmip-man 163/tcp # CMIP/TCP Manager
-cmip-agent 164/udp # CMIP/TCP Agent
-cmip-agent 164/tcp # CMIP/TCP Agent
-# Amatzia Ben-Artzi <---none--->
-xns-courier 165/udp # Xerox
-xns-courier 165/tcp # Xerox
-# Susie Armstrong <Armstron...@XEROX.COM>
-s-net 166/udp # Sirius Systems
-s-net 166/tcp # Sirius Systems
-# Brian Lloyd <br...@lloyd.com>
-namp 167/udp # NAMP
-namp 167/tcp # NAMP
-# Marty Schoffstahl <sch...@NISC.NYSER.NET>
-rsvd 168/udp # RSVD
-rsvd 168/tcp # RSVD
-# Neil Todd <mcvax!ist.co.uk!ne...@UUNET.UU.NET>
-send 169/udp # SEND
-send 169/tcp # SEND
-# William D. Wisner <wis...@HAYES.FAI.ALASKA.EDU>
-print-srv 170/udp # Network PostScript
-print-srv 170/tcp # Network PostScript
-# Brian Reid <re...@DECWRL.DEC.COM>
-multiplex 171/udp # Network Innovations Multiplex
-multiplex 171/tcp # Network Innovations Multiplex
-cl/1 172/udp # Network Innovations CL/1
-cl/1 172/tcp # Network Innovations CL/1
-# Kevin DeVault <<---none--->
-xyplex-mux 173/udp # Xyplex
-xyplex-mux 173/tcp # Xyplex
-# Bob Stewart <STE...@XYPLEX.COM>
-mailq 174/udp # MAILQ
-mailq 174/tcp # MAILQ
-# Rayan Zachariassen <ra...@AI.TORONTO.EDU>
-vmnet 175/udp # VMNET
-vmnet 175/tcp # VMNET
-# Christopher Tengi <te...@Princeton.EDU>
-genrad-mux 176/udp # GENRAD-MUX
-genrad-mux 176/tcp # GENRAD-MUX
-# Ron Thornton <thor...@qm7501.genrad.com>
-xdmcp 177/udp # X Display Manager Control Protocol
-xdmcp 177/tcp # X Display Manager Control Protocol
-# Robert W. Scheifler <R...@XX.LCS.MIT.EDU>
-nextstep 178/udp # NextStep Window Server
-nextstep 178/tcp # NextStep Window Server
-# Leo Hourvitz <l...@NEXT.COM>
-bgp 179/udp # Border Gateway Protocol
-bgp 179/tcp # Border Gateway Protocol
-# Kirk Lougheed <LOUG...@MATHOM.CISCO.COM>
-ris 180/udp # Intergraph
-ris 180/tcp # Intergraph
-# Dave Buehmann <ingr!da...@UUNET.UU.NET>
-unify 181/udp # Unify
-unify 181/tcp # Unify
-# Mark Ainsley <ianapor...@unify.com>
-audit 182/udp # Unisys Audit SITP
-audit 182/tcp # Unisys Audit SITP
-# Gil Greenbaum <gc...@nisd.cam.unisys.com>
-ocbinder 183/udp # OCBinder
-ocbinder 183/tcp # OCBinder
-ocserver 184/udp # OCServer
-ocserver 184/tcp # OCServer
-# Jerrilynn Okamura <--none--->
-remote-kis 185/udp # Remote-KIS
-remote-kis 185/tcp # Remote-KIS
-kis 186/udp # KIS Protocol
-kis 186/tcp # KIS Protocol
-# Ralph Droms <rdr...@NRI.RESTON.VA.US>
-aci 187/udp # Application Communication Interface
-aci 187/tcp # Application Communication Interface
-# Rick Carlos <rick.ticipa.csc.ti.com>
-mumps 188/udp # Plus Five's MUMPS
-mumps 188/tcp # Plus Five's MUMPS
-# Hokey Stenn <ho...@PLUS5.COM>
-qft 189/udp # Queued File Transport
-qft 189/tcp # Queued File Transport
-# Wayne Schroeder <schr...@SDS.SDSC.EDU>
-gacp 190/udp # Gateway Access Control Protocol
-gacp 190/tcp # Gateway Access Control Protocol
-# C. Philip Wood <c...@LANL.GOV>
-prospero 191/udp # Prospero Directory Service
-prospero 191/tcp # Prospero Directory Service
-# B. Clifford Neuman <b...@isi.edu>
-osu-nms 192/udp # OSU Network Monitoring System
-osu-nms 192/tcp # OSU Network Monitoring System
-# Doug Karl <KAR...@OSU-20.IRCC.OHIO-STATE.EDU>
-srmp 193/udp # Spider Remote Monitoring Protocol
-srmp 193/tcp # Spider Remote Monitoring Protocol
-# Ted J. Socolofsky <Te...@SPIDER.CO.UK>
-irc 194/udp # Internet Relay Chat Protocol
-irc 194/tcp # Internet Relay Chat Protocol
-# Jarkko Oikarinen <j...@TOLSUN.OULU.FI>
-dn6-nlm-aud 195/udp # DNSIX Network Level Module Audit
-dn6-nlm-aud 195/tcp # DNSIX Network Level Module Audit
-dn6-smm-red 196/udp # DNSIX Session Mgt Module Audit Redir
-dn6-smm-red 196/tcp # DNSIX Session Mgt Module Audit Redir
-# Lawrence Lebahn <DI...@PAXRV-NES.NAVY.MIL>
-dls 197/udp # Directory Location Service
-dls 197/tcp # Directory Location Service
-dls-mon 198/udp # Directory Location Service Monitor
-dls-mon 198/tcp # Directory Location Service Monitor
-# Scott Bellew <s...@cs.purdue.edu>
-smux 199/udp # SMUX
-smux 199/tcp # SMUX
-# Marshall Rose <mr...@dbc.mtview.ca.us>
-src 200/udp # IBM System Resource Controller
-src 200/tcp # IBM System Resource Controller
-# Gerald McBrearty <---none--->
-at-rtmp 201/udp # AppleTalk Routing Maintenance
-at-rtmp 201/tcp # AppleTalk Routing Maintenance
-at-nbp 202/udp # AppleTalk Name Binding
-at-nbp 202/tcp # AppleTalk Name Binding
-at-3 203/udp # AppleTalk Unused
-at-3 203/tcp # AppleTalk Unused
-at-echo 204/udp # AppleTalk Echo
-at-echo 204/tcp # AppleTalk Echo
-at-5 205/udp # AppleTalk Unused
-at-5 205/tcp # AppleTalk Unused
-at-zis 206/udp # AppleTalk Zone Information
-at-zis 206/tcp # AppleTalk Zone Information
-at-7 207/udp # AppleTalk Unused
-at-7 207/tcp # AppleTalk Unused
-at-8 208/udp # AppleTalk Unused
-at-8 208/tcp # AppleTalk Unused
-# Rob Chandhok <chan...@gnome.cs.cmu.edu>
-qmtp 209/udp # The Quick Mail Transfer Protocol
-qmtp 209/tcp # The Quick Mail Transfer Protocol
-# Dan Bernstein <d...@silverton.berkeley.edu>
-z39.50 210/udp # ANSI Z39.50
-z39.50 210/tcp # ANSI Z39.50
-# Mark H. Needleman <ma...@sirsi.com>
-914c/g 211/udp # Texas Instruments 914C/G Terminal
-914c/g 211/tcp # Texas Instruments 914C/G Terminal
-# Bill Harrell <---none--->
-anet 212/udp # ATEXSSTR
-anet 212/tcp # ATEXSSTR
-# Jim Taylor <tay...@heart.epps.kodak.com>
-ipx 213/udp # IPX
-ipx 213/tcp # IPX
-# Don Provan <do...@xlnvax.novell.com>
-vmpwscs 214/udp # VM PWSCS
-vmpwscs 214/tcp # VM PWSCS
-# Dan Shia <dset!sh...@uunet.UU.NET>
-softpc 215/udp # Insignia Solutions
-softpc 215/tcp # Insignia Solutions
-# Martyn Thomas <---none--->
-CAIlic 216/udp # Computer Associates Int'l License Server
-CAIlic 216/tcp # Computer Associates Int'l License Server
-# Chuck Spitz <spi...@cai.com>
-dbase 217/udp # dBASE Unix
-dbase 217/tcp # dBASE Unix
-# Don Gibson
-# <sequent!aero!twinsun!ashtate.A-T.COM!do...@uunet.UU.NET>
-mpp 218/udp # Netix Message Posting Protocol
-mpp 218/tcp # Netix Message Posting Protocol
-# Shannon Yeh <y...@netix.com>
-uarps 219/udp # Unisys ARPs
-uarps 219/tcp # Unisys ARPs
-# Ashok Marwaha <---none--->
-imap3 220/udp # Interactive Mail Access Protocol v3
-imap3 220/tcp # Interactive Mail Access Protocol v3
-# James Rice <RI...@SUMEX-AIM.STANFORD.EDU>
-fln-spx 221/udp # Berkeley rlogind with SPX auth
-fln-spx 221/tcp # Berkeley rlogind with SPX auth
-rsh-spx 222/udp # Berkeley rshd with SPX auth
-rsh-spx 222/tcp # Berkeley rshd with SPX auth
-cdc 223/udp # Certificate Distribution Center
-cdc 223/tcp # Certificate Distribution Center
-# Kannan Alagappan <kan...@sejour.enet.dec.com>
-########### Possible Conflict of Port 222 with "Masqdialer"##############
-### Contact for Masqdialer is Charles Wright <cpwr...@villagenet.com>###
-masqdialer 224/udp # masqdialer
-masqdialer 224/tcp # masqdialer
-# Charles Wright <cpwr...@villagenet.com>
-# 225-241 Reserved
-# Jon Postel <pos...@isi.edu>
-direct 242/udp # Direct
-direct 242/tcp # Direct
-# Herb Sutter <He...@cntc.com>
-sur-meas 243/udp # Survey Measurement
-sur-meas 243/tcp # Survey Measurement
-# Dave Clark <d...@LCS.MIT.EDU>
-inbusiness 244/udp # inbusiness
-inbusiness 244/tcp # inbusiness
-# Derrick Hisatake <derrick.i...@intel.com>
-link 245/udp # LINK
-link 245/tcp # LINK
-dsp3270 246/udp # Display Systems Protocol
-dsp3270 246/tcp # Display Systems Protocol
-# Weldon J. Showalter <Ga...@MINTAKA.DCA.MIL>
-subntbcst_tftp 247/udp # SUBNTBCST_TFTP
-subntbcst_tftp 247/tcp # SUBNTBCST_TFTP
-# John Fake <fa...@us.ibm.com>
-bhfhs 248/udp # bhfhs
-bhfhs 248/tcp # bhfhs
-# John Kelly <jo...@bellhow.com>
-# 249-255 Reserved
-# Jon Postel <pos...@isi.edu>
-rap 256/udp # RAP
-rap 256/tcp # RAP
-# J.S. Greenfield <gre...@raleigh.ibm.com>
-set 257/udp # Secure Electronic Transaction
-set 257/tcp # Secure Electronic Transaction
-# Donald Eastlake <de...@torque.pothole.com>
-yak-chat 258/udp # Yak Winsock Personal Chat
-yak-chat 258/tcp # Yak Winsock Personal Chat
-# Brian Bandy <bba...@swbell.net>
-esro-gen 259/udp # Efficient Short Remote Operations
-esro-gen 259/tcp # Efficient Short Remote Operations
-# Mohsen Banan <moh...@rostam.neda.com>
-openport 260/udp # Openport
-openport 260/tcp # Openport
-# John Marland <jmar...@dean.openport.com>
-nsiiops 261/udp # IIOP Name Service over TLS/SSL
-nsiiops 261/tcp # IIOP Name Service over TLS/SSL
-# Jeff Stewart <jste...@netscape.com>
-arcisdms 262/udp # Arcisdms
-arcisdms 262/tcp # Arcisdms
-# Russell Crook (r...@sni.ca>
-hdap 263/udp # HDAP
-hdap 263/tcp # HDAP
-# Troy Gau <tr...@zyxel.com>
-bgmp 264/udp # BGMP
-bgmp 264/tcp # BGMP
-# Dave Thaler <tha...@eecs.umich.edu>
-x-bone-ctl 265/udp # X-Bone CTL
-x-bone-ctl 265/tcp # X-Bone CTL
-# Joe Touch <to...@isi.edu>
-sst 266/udp # SCSI on ST
-sst 266/tcp # SCSI on ST
-# Donald D. Woelz <d...@genroco.com>
-td-service 267/udp # Tobit David Service Layer
-td-service 267/tcp # Tobit David Service Layer
-td-replica 268/udp # Tobit David Replica
-td-replica 268/tcp # Tobit David Replica
-# Franz-Josef Leuders <devel...@tobit.com>
-# 269-279 Unassigned
-http-mgmt 280/udp # http-mgmt
-http-mgmt 280/tcp # http-mgmt
-# Adrian Pell
-# <PELL_ADRIAN/HP-UnitedK...@hplb.hpl.hp.com>
-personal-link 281/udp # Personal Link
-personal-link 281/tcp # Personal Link
-# Dan Cummings <d...@cnr.com>
-cableport-ax 282/udp # Cable Port A/X
-cableport-ax 282/tcp # Cable Port A/X
-# Craig Langfahl <Craig_J_...@ccm.ch.intel.com>
-rescap 283/udp # rescap
-rescap 283/tcp # rescap
-# Paul Hoffman <phof...@imc.org>
-corerjd 284/udp # corerjd
-corerjd 284/tcp # corerjd
-# Chris Thornhill <c...@corenetworks.com>
-# 285 Unassigned
-fxp-1 286/udp # FXP-1
-fxp-1 286/tcp # FXP-1
-# James Darnall <j...@cennoid.com>
-k-block 287/udp # K-BLOCK
-k-block 287/tcp # K-BLOCK
-# Simon P Jackson <ja...@kring.co.uk>
-# 288-307 Unassigned
-novastorbakcup 308/udp # Novastor Backup
-novastorbakcup 308/tcp # Novastor Backup
-# Brian Dickman <br...@novastor.com>
-entrusttime 309/udp # EntrustTime
-entrusttime 309/tcp # EntrustTime
-# Peter Whittaker <p...@entrust.com>
-bhmds 310/udp # bhmds
-bhmds 310/tcp # bhmds
-# John Kelly <jo...@bellhow.com>
-asip-webadmin 311/udp # AppleShare IP WebAdmin
-asip-webadmin 311/tcp # AppleShare IP WebAdmin
-# Ann Huang <annh...@apple.com>
-vslmp 312/udp # VSLMP
-vslmp 312/tcp # VSLMP
-# Gerben Wierda <Gerben...@RnA.nl>
-magenta-logic 313/udp # Magenta Logic
-magenta-logic 313/tcp # Magenta Logic
-# Karl Rousseau <k...@netfusion.co.uk>
-opalis-robot 314/udp # Opalis Robot
-opalis-robot 314/tcp # Opalis Robot
-# Laurent Domenech, Opalis <ldom...@opalis.com>
-dpsi 315/udp # DPSI
-dpsi 315/tcp # DPSI
-# Tony Scamurra <To...@DesktopPaging.com>
-decauth 316/udp # decAuth
-decauth 316/tcp # decAuth
-# Michael Agishtein <mi...@unx.dec.com>
-zannet 317/udp # Zannet
-zannet 317/tcp # Zannet
-# Zan Oliphant <z...@accessone.com>
-pkix-timestamp 318/udp # PKIX TimeStamp
-pkix-timestamp 318/tcp # PKIX TimeStamp
-# Robert Zuccherato <robert.z...@entrust.com>
-ptp-event 319/udp # PTP Event
-ptp-event 319/tcp # PTP Event
-ptp-general 320/udp # PTP General
-ptp-general 320/tcp # PTP General
-# John Eidson <eid...@hpl.hp.com>
-pip 321/udp # PIP
-pip 321/tcp # PIP
-# Gordon Mohr <goj...@usa.net>
-rtsps 322/udp # RTSPS
-rtsps 322/tcp # RTSPS
-# Anders Klemets <ande...@microsoft.com>
-# 323-332 Unassigned
-texar 333/udp # Texar Security Port
-texar 333/tcp # Texar Security Port
-# Eugen Bacic <eba...@texar.com>
-# 334-343 Unassigned
-pdap 344/udp # Prospero Data Access Protocol
-pdap 344/tcp # Prospero Data Access Protocol
-# B. Clifford Neuman <b...@isi.edu>
-pawserv 345/udp # Perf Analysis Workbench
-pawserv 345/tcp # Perf Analysis Workbench
-zserv 346/udp # Zebra server
-zserv 346/tcp # Zebra server
-fatserv 347/udp # Fatmen Server
-fatserv 347/tcp # Fatmen Server
-csi-sgwp 348/udp # Cabletron Management Protocol
-csi-sgwp 348/tcp # Cabletron Management Protocol
-mftp 349/udp # mftp
-mftp 349/tcp # mftp
-# Dave Feinleib <dav...@microsoft.com>
-matip-type-a 350/udp # MATIP Type A
-matip-type-a 350/tcp # MATIP Type A
-matip-type-b 351/udp # MATIP Type B
-matip-type-b 351/tcp # MATIP Type B
-# Alain Robert <aro...@par.sita.int>
-# The following entry records an unassigned but widespread use
-bhoetty 351/udp # bhoetty
-bhoetty 351/tcp # bhoetty (added 5/21/97)
-# John Kelly <jo...@bellhow.com>
-dtag-ste-sb 352/udp # DTAG
-dtag-ste-sb 352/tcp # DTAG (assigned long ago)
-# Ruediger Wald <wa...@ez-darmstadt.telekom.de>
-# The following entry records an unassigned but widespread use
-bhoedap4 352/udp # bhoedap4
-bhoedap4 352/tcp # bhoedap4 (added 5/21/97)
-# John Kelly <jo...@bellhow.com>
-ndsauth 353/udp # NDSAUTH
-ndsauth 353/tcp # NDSAUTH
-# Jayakumar Ramalingam <jaya...@novell.com>
-bh611 354/udp # bh611
-bh611 354/tcp # bh611
-# John Kelly <jo...@bellhow.com>
-datex-asn 355/udp # DATEX-ASN
-datex-asn 355/tcp # DATEX-ASN
-# Kenneth Vaughn <kva...@mail.viggen.com>
-cloanto-net-1 356/udp # Cloanto Net 1
-cloanto-net-1 356/tcp # Cloanto Net 1
-# Michael Battilana <mcb-...@cloanto.com>
-bhevent 357/udp # bhevent
-bhevent 357/tcp # bhevent
-# John Kelly <jo...@bellhow.com>
-shrinkwrap 358/udp # Shrinkwrap
-shrinkwrap 358/tcp # Shrinkwrap
-# Bill Simpson <wsim...@greendragon.com>
-nsrmp 359/udp # Network Security Risk Management Protocol
-nsrmp 359/tcp # Network Security Risk Management Protocol
-# Eric Jacksch <jac...@tenebris.ca>
-scoi2odialog 360/udp # scoi2odialog
-scoi2odialog 360/tcp # scoi2odialog
-# Keith Petley <kei...@sco.COM>
-semantix 361/udp # Semantix
-semantix 361/tcp # Semantix
-# Semantix <xsSu...@semantix.com>
-srssend 362/udp # SRS Send
-srssend 362/tcp # SRS Send
-# Curt Mayer <cu...@emergent.com>
-rsvp_tunnel 363/udp # RSVP Tunnel
-rsvp_tunnel 363/tcp # RSVP Tunnel
-# Andreas Terzis <ter...@cs.ucla.edu>
-aurora-cmgr 364/udp # Aurora CMGR
-aurora-cmgr 364/tcp # Aurora CMGR
-# Philip Budne <bu...@auroratech.com>
-dtk 365/udp # DTK
-dtk 365/tcp # DTK
-# Fred Cohen <f...@all.net>
-odmr 366/udp # ODMR
-odmr 366/tcp # ODMR
-#