DEB_DEPENDS += libssl1.0-dev
DEB_DEPENDS += python-all python-pip
DEB_DEPENDS += python-dev python-all python-pip python-virtualenv
+else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-10)
+ DEB_DEPENDS += libelf-dev # for libbpf (af_xdp)
else
DEB_DEPENDS += libssl-dev
endif
import sys
from subprocess import Popen, PIPE
-assert sys.version_info >= (3, 6), \
+assert sys.version_info >= (3, 5), \
"Not supported Python version: {}".format(sys.version)
log = logging.getLogger('vppapigen')
def parse_filename(self, filename, debug=0):
if self.revision:
- git_show = f'git show {self.revision}:{filename}'
+ git_show = 'git show {}:{}'.format(self.revision, filename)
proc = Popen(git_show.split(), stdout=PIPE, encoding='utf-8')
try:
data, errs = proc.communicate()
if proc.returncode != 0:
- print(f'File not found: {self.revision}:{filename}', file=sys.stderr)
+ print('File not found: {}:{}'.format(self.revision,
+ filename), file=sys.stderr)
sys.exit(2)
return self.parse_string(data, debug=debug)
except Exception as e:
with open(filename, encoding='utf-8') as fd:
return self.parse_fd(fd, None)
except FileNotFoundError:
- print(f'File not found: {filename}', file=sys.stderr)
+ print('File not found: {}'.format(filename), file=sys.stderr)
sys.exit(2)
def autoreply_block(self, name, parent):
static void
virtio_pci_modern_get_device_mac (vlib_main_t * vm, virtio_if_t * vif)
{
- *((u32 *) vif->mac_addr) =
- virtio_pci_reg_read_u32 (vif, VIRTIO_MAC_OFFSET (vif));
- *((u16 *) (vif->mac_addr + 4)) =
+ vif->mac_addr32 = virtio_pci_reg_read_u32 (vif, VIRTIO_MAC_OFFSET (vif));
+ vif->mac_addr16 =
virtio_pci_reg_read_u16 (vif, VIRTIO_MAC_OFFSET (vif) + 4);
}
static void
virtio_pci_modern_set_device_mac (vlib_main_t * vm, virtio_if_t * vif)
{
- virtio_pci_reg_write_u32 (vif, VIRTIO_MAC_OFFSET (vif),
- *((u32 *) vif->mac_addr));
+ virtio_pci_reg_write_u32 (vif, VIRTIO_MAC_OFFSET (vif), vif->mac_addr32);
virtio_pci_reg_write_u16 (vif, VIRTIO_MAC_OFFSET (vif) + 4,
- *((u16 *) (vif->mac_addr + 4)));
+ vif->mac_addr16);
}
static u16