def to_bitstream(self):
        '''
        Create bitstream from properties
        '''
        # Verify that properties make sense
        self.sanitize()

        # Start with the priorities and weights
        bitstream = BitArray('uint:8=%d, uint:8=%d, uint:8=%d, '
                             'uint:8=%d' % (self.priority,
                                            self.weight,
                                            self.m_priority,
                                            self.m_weight))

        # Add padding
        bitstream += self._reserved1

        # Add the flags
        bitstream += BitArray('bool=%d, bool=%d, bool=%d'
                              % (self.local,
                                 self.probed_locator,
                                 self.reachable))

        # Add the locator
        bitstream += get_bitstream_for_afi_address(self.address)

        return bitstream
Create bitstream from properties