+#ifdef TUN_BSD
+
+struct tunnel {
+ const tunnel_ops *ops; /* Pointer to operations */
+ sel_file f; /* Selector for tunnel device */
+ struct peer *p; /* Pointer to my peer */
+ unsigned n; /* Number of my tunnel device */
+};
+
+/* --- @t_ifname@ --- *
+ *
+ * Arguments: @tunnel *t@ = pointer to tunnel block
+ *
+ * Returns: A pointer to the tunnel's interface name.
+ */
+
+static const char *t_ifname(tunnel *t)
+{
+ static char buf[8];
+ sprintf(buf, "tun%u", t->n);
+ return (buf);
+}