metasploit-framework/lib/rex/proto/kerberos/model/element.rb

52 lines
1.1 KiB
Ruby
Raw Normal View History

2014-12-10 15:54:57 +00:00
# -*- coding: binary -*-
2014-12-09 21:53:29 +00:00
module Rex
module Proto
module Kerberos
module Model
# This class provides a representation of a principal, an asset (e.g., a
# workstation user or a network server) on a network.
class Element
2014-12-09 21:53:29 +00:00
include Rex::Proto::Kerberos::Model
def self.attr_accessor(*vars)
@attributes ||= []
@attributes.concat vars
super(*vars)
end
def self.attributes
@attributes
end
2014-12-09 21:53:29 +00:00
def self.decode(input)
elem = self.new
elem.decode(input)
end
def initialize(options = {})
self.class.attributes.each do |attr|
if options.has_key?(attr)
m = (attr.to_s + '=').to_sym
self.send(m, options[attr])
end
end
end
2014-12-09 21:53:29 +00:00
def attributes
self.class.attributes
2014-12-09 21:53:29 +00:00
end
def decode(input)
self
end
def encode
''
end
end
end
end
end
end