code: def pack(self):
          
          diag = (self.ver << 5) + self.diag
          flags = (self.state << 6) + self.flags
          length = len(self)
  
          return struct.pack(self._PACK_STR, diag, flags, self.detect_mult,
                             length, self.my_discr, self.your_discr,
                             self.desired_min_tx_interval,
                             self.required_min_rx_interval,
                             self.required_min_echo_rx_interval)
docs: Encode a BFD Control packet without authentication section.