C declarations etc.).
# Define macros for defining sections
m4_define(CF_ZONE, `m4_divert($1)/* $2 from m4___file__ */')
m4_define(CF_HDR, `CF_ZONE(1, Headers)')
+m4_define(CF_DEFINES, `CF_ZONE(1, Defines)')
m4_define(CF_DECLS, `CF_ZONE(2, Declarations)')
m4_define(CF_GRAMMAR, `CF_ZONE(3, Grammar)')
m4_define(CF_CODE, `CF_ZONE(4, C Code)')
CF_HDR
+CF_DEFINES
+
#define P(a,b) ((a<<8) | b)
CF_DECLS
CF_HDR
-static struct proto_config *this_proto;
-static struct iface_patt *this_ipatt;
-
#include "nest/rt-dev.h"
#include "nest/password.h"
#include "nest/cmds.h"
+CF_DEFINES
+
+static struct proto_config *this_proto;
+static struct iface_patt *this_ipatt;
+
CF_DECLS
CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
#include "proto/rip/rip.h"
#include "nest/iface.h"
+CF_DEFINES
+
#define RIP_CFG ((struct rip_proto_config *) this_proto)
#define RIP_IPATT ((struct rip_patt *) this_ipatt)
#include "proto/static/static.h"
+CF_DEFINES
+
static struct static_route *this_srt;
CF_DECLS
#include "lib/krt.h"
+CF_DEFINES
+
#define THIS_KRT ((struct krt_config *) this_proto)
#define THIS_KIF ((struct kif_config *) this_proto)