Exemplo n.º 1
0
	def get(self, *args, **kwargs):
		if kwargs.has_key('subnet'):
			if "/" in kwargs['subnet']:
				kwargs['subnet'] = kwargs['subnet'].split("/")[0]
			subnet = self.ipcalc.dqtoi(kwargs['subnet'])
			return BaseBackend.get(self, subnet=subnet)
		else:
			return BaseBackend.get(self, *args, **kwargs)
Exemplo n.º 2
0
	def delete(self, *args, **kwargs):
		try:
			return BaseBackend.delete(self, *args, **kwargs)
		except:
			(result, ip) = self.ip.get(ip=kwargs['ip'])
			if not result:
				return (False, ip)
			kwargs['ip'] = ip
			return BaseBackend.delete(self, *args, **kwargs)
Exemplo n.º 3
0
 def delete(self, *args, **kwargs):
     try:
         return BaseBackend.delete(self, *args, **kwargs)
     except:
         (result, ip) = self.ip.get(ip=kwargs['ip'])
         if not result:
             return (False, ip)
         kwargs['ip'] = ip
         return BaseBackend.delete(self, *args, **kwargs)
Exemplo n.º 4
0
 def __init__(self):
     BaseBackend.__init__(self, models.Listing)
     self.ip = IP()
     self.sensor = Sensor()
     self.host = Host()
     self.reason = Reason()
     self.duration = Duration()
     self.user = User()
     self.historylisting = HistoryListing()
     self.config = Config()
     self.ipcalc = IPCalc()
Exemplo n.º 5
0
	def __init__(self):
		BaseBackend.__init__(self, models.Listing)
		self.ip = IP()
		self.sensor = Sensor()
		self.host = Host()
		self.reason = Reason()
		self.duration = Duration()
		self.user = User()
		self.historylisting = HistoryListing()
		self.config = Config()
		self.ipcalc = IPCalc()
Exemplo n.º 6
0
 def __init__(self):
     BaseBackend.__init__(self, models.HistoryListing)
     self.netdata = NetData()
     self.ipcalc = IPCalc()
Exemplo n.º 7
0
 def __init__(self):
     BaseBackend.__init__(self, models.Key)
     self.config = Config()
     self.encryption = Encryption(self.config["blacklist.keystore.psk"])
Exemplo n.º 8
0
	def get(self, *args, **kwargs):
		(result, keydata) = BaseBackend.get(self, name=kwargs["name"])
		if result:
			keydata.data = self.encryption.decrypt(keydata.data)
		return (result, keydata)
Exemplo n.º 9
0
	def __init__(self):
		BaseBackend.__init__(self, models.Reason)
Exemplo n.º 10
0
	def __init__(self):
		BaseBackend.__init__(self, models.Country)
Exemplo n.º 11
0
 def __init__(self):
     BaseBackend.__init__(self, models.Country)
Exemplo n.º 12
0
	def __init__(self):
		BaseBackend.__init__(self, models.ASNum)
		self.rir = RIR()
		self.country = Country()
Exemplo n.º 13
0
 def __init__(self):
     BaseBackend.__init__(self, models.Rule)
     self.sensor = Sensor()
Exemplo n.º 14
0
	def get(self, *args, **kwargs):
		(dq , mask) = self.ipcalc.parse_addr(kwargs['ip'])
		ip = self.ipcalc.dqtoi(dq)
		return BaseBackend.get(self, *args, ip=ip)
Exemplo n.º 15
0
	def __init__(self):
		BaseBackend.__init__(self, models.IP)
		self.netdata = NetData()
		self.ipcalc = IPCalc()
		self.subnet = Subnet()
Exemplo n.º 16
0
	def __init__(self):
		BaseBackend.__init__(self, models.Sensor)
Exemplo n.º 17
0
	def has(self, *args, **kwargs):
		if "/" in kwargs['subnet']:
			kwargs['subnet'] = kwargs['subnet'].split("/")[0]
		subnet = self.ipcalc.dqtoi(kwargs['subnet'])
		return BaseBackend.has(self, subnet=subnet)
Exemplo n.º 18
0
 def __init__(self):
     BaseBackend.__init__(self, models.Duration)
Exemplo n.º 19
0
 def __init__(self):
     BaseBackend.__init__(self, models.Reason)
Exemplo n.º 20
0
 def __init__(self):
     BaseBackend.__init__(self, models.IP)
     self.netdata = NetData()
     self.ipcalc = IPCalc()
     self.subnet = Subnet()
Exemplo n.º 21
0
 def __init__(self):
     BaseBackend.__init__(self, models.Host)
     self.ip = IP()
     self.user = User()
Exemplo n.º 22
0
 def get(self, *args, **kwargs):
     (dq, mask) = self.ipcalc.parse_addr(kwargs['ip'])
     ip = self.ipcalc.dqtoi(dq)
     return BaseBackend.get(self, *args, ip=ip)
Exemplo n.º 23
0
 def __init__(self):
     BaseBackend.__init__(self, models.Rule)
     self.sensor = Sensor()
Exemplo n.º 24
0
	def __init__(self):
		BaseBackend.__init__(self, models.Duration)
Exemplo n.º 25
0
	def __init__(self):
		BaseBackend.__init__(self, models.Key)
		self.config = Config()
		self.encryption  = Encryption(self.config["blacklist.keystore.psk"])
Exemplo n.º 26
0
 def __init__(self):
     BaseBackend.__init__(self, models.Peering)
     self.config = Config()
     self.encryption = Encryption(self.config["blacklist.keystore.psk"])
     self.ipcalc = IPCalc()
     self.netdata = NetData()
Exemplo n.º 27
0
	def __init__(self):
		BaseBackend.__init__(self, models.Peering)
		self.config = Config()
		self.encryption = Encryption(self.config["blacklist.keystore.psk"])
		self.ipcalc = IPCalc()
		self.netdata = NetData()
Exemplo n.º 28
0
	def __init__(self):
		BaseBackend.__init__(self, models.Host)
		self.ip = IP()
		self.user = User()
Exemplo n.º 29
0
 def get(self, *args, **kwargs):
     (result, keydata) = BaseBackend.get(self, name=kwargs["name"])
     if result:
         keydata.data = self.encryption.decrypt(keydata.data)
     return (result, keydata)
Exemplo n.º 30
0
	def __init__(self):
		BaseBackend.__init__(self, models.Subnet)
		self.ipcalc = IPCalc()
		self.asnum = ASNum()
		self.country = Country()
		self.rir = RIR()
Exemplo n.º 31
0
	def __init__(self):
		BaseBackend.__init__(self, models.User)
Exemplo n.º 32
0
 def __init__(self):
     BaseBackend.__init__(self, models.ASNum)
     self.rir = RIR()
     self.country = Country()