reimplement with new tandem and new xdr

Signed-off-by: Jan Dvořák <mordae@anilinux.org>