pkgsrc/net/irrtoolset-nox11/patches/patch-cz
spz 753b403c52 fix the asplain patch: since the routing registries currently won't find
asplained autnums, make asdot the default, but prepare for them switching
by asking the asplained format before giving up, independently of any
command line settings. Bump pkgrev, too.
2009-03-15 20:10:35 +00:00

33 lines
774 B
Text

$NetBSD: patch-cz,v 1.3 2009/03/15 20:10:36 spz Exp $
--- src/rpsl/rpsl/rpsl_asnum.hh.orig 2009-03-15 16:45:45.000000000 +0100
+++ src/rpsl/rpsl/rpsl_asnum.hh
@@ -0,0 +1,28 @@
+#ifndef ASNUM_HH
+#define ASNUM_HH 1
+
+extern bool opt_asdot;
+
+inline int asnum_string(char *buf, unsigned int asno)
+{
+ if (asno > 65535 && opt_asdot)
+ return sprintf(buf, "AS%d.%d", asno>>16, asno&0xffff);
+ else
+ return sprintf(buf, "AS%d", asno);
+}
+
+inline int asnum_string_dot(char *buf, unsigned int asno)
+{
+ if (asno > 65535)
+ return sprintf(buf, "AS%d.%d", asno>>16, asno&0xffff);
+ else
+ return sprintf(buf, "AS%d", asno);
+}
+
+inline int asnum_string_plain(char *buf, unsigned int asno)
+{
+ return sprintf(buf, "AS%d", asno);
+}
+
+#endif
+