How to use the pypacker.pypacker.Packet.bin function in pypacker

To help you get started, we’ve selected a few pypacker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mike01 / pypacker / pypacker / layer12 / ethernet.py View on Github external
def bin(self, update_auto_fields=True):
		# padding needs to be placed at the very end
		return pypacker.Packet.bin(self, update_auto_fields=update_auto_fields) + self.padding
github mike01 / pypacker / pypacker / layer12 / ospf.py View on Github external
def __calc_sum(self):
		self._sum = 0
		self._sum = pypacker.in_cksum(pypacker.Packet.bin(self))
github mike01 / pypacker / pypacker / layer12 / btle.py View on Github external
def bin(self, update_auto_fields=True):
		"""Custom bin(): handle crc for BTLE."""
		return pypacker.Packet.bin(self, update_auto_fields=update_auto_fields) + self.crc
github mike01 / pypacker / pypacker / layer12 / vrrp.py View on Github external
def _update_fields(self):
		if self.sum_au_active and self._changed():
			# logger.debug(">>> IP: calculating sum")
			# reset checksum for recalculation,  mark as changed / clear cache
			self.sum = 0
			# logger.debug(">>> IP: bytes for sum: %s" % self.header_bytes)
			self.sum = checksum.in_cksum(pypacker.Packet.bin(self, update_auto_fields=True))
github mike01 / pypacker / pypacker / layer4 / sctp.py View on Github external
def bin(self, update_auto_fields=True):
		return pypacker.Packet.bin(self, update_auto_fields=update_auto_fields) + self.padding
github mike01 / pypacker / pypacker / layer12 / ospf.py View on Github external
def bin(self):
		if self.__needs_checksum_update():
			self.__calc_sum()
		return pypacker.Packet.bin(self)
github mike01 / pypacker / pypacker / layer12 / radiotap.py View on Github external
def bin(self, update_auto_fields=True):
		"""Custom bin(): handle FCS."""
		return pypacker.Packet.bin(self, update_auto_fields=update_auto_fields) + self.fcs