mgcp: Introduce a trunk config for multiple trunks.

A trunk will always have 32 endpoints to be used and we allow
a sparse allocation of endpoints.
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index df84979..54a3a6e 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -103,6 +103,8 @@
 };
 
 struct mgcp_trunk_config {
+	struct llist_head entry;
+
 	struct mgcp_config *cfg;
 
 	int trunk_nr;
@@ -150,6 +152,7 @@
 
 	/* trunk handling */
 	struct mgcp_trunk_config trunk;
+	struct llist_head trunks;
 };
 
 /* config management */
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index cefbc3e..7c6bb54 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -147,5 +147,8 @@
 	return endpoint + 60;
 }
 
+struct mgcp_trunk_config *mgcp_trunk_alloc(struct mgcp_config *cfg, int index);
+struct mgcp_trunk_config *mgcp_trunk_num(struct mgcp_config *cfg, int index);
+
 
 #endif
diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h
index 6ed5f05..516c8c2 100644
--- a/openbsc/include/openbsc/vty.h
+++ b/openbsc/include/openbsc/vty.h
@@ -34,6 +34,7 @@
 	NAT_BSC_NODE,
 	MSC_NODE,
 	OM2K_NODE,
+	TRUNK_NODE,
 };
 
 extern int bsc_vty_is_config_node(struct vty *vty, int node);