tools/graph2dot: factorize code printing non-media specific link information