Revision 9fac310d

View differences:

client/Makefile
1
source=client.c
1
source=client.c commands.c util.c
2 2
root-rel=../
3 3
dir-name=client
4 4

  
client/client.c
6 6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7 7
 */
8 8

  
9
#include <stdio.h>
10
#include <string.h>
11
#include <stdlib.h>
12
#include <unistd.h>
13

  
9 14
#include "nest/bird.h"
15
#include "lib/resource.h"
10 16
#include "client/client.h"
11 17

  
12
struct cmd_info {
13
  char *command;
14
  char *args;
15
  char *help;
16
};
18
static char *opt_list = "";
17 19

  
18
static struct cmd_info command_table[] = {
19
#include "conf/commands.h"
20
};
20
static void
21
usage(void)
22
{
23
  fprintf(stderr, "Usage: birdc\n");
24
  exit(1);
25
}
26

  
27
static void
28
parse_args(int argc, char **argv)
29
{
30
  int c;
31

  
32
  while ((c = getopt(argc, argv, opt_list)) >= 0)
33
    switch (c)
34
      {
35
      default:
36
	usage();
37
      }
38
  if (optind < argc)
39
    usage();
40
}
21 41

  
22 42
int
23 43
main(int argc, char **argv)
24 44
{
25
  return client_main(argc, argv);	/* Call sysdep code */
45
#ifdef HAVE_LIBDMALLOC
46
  if (!getenv("DMALLOC_OPTIONS"))
47
    dmalloc_debug(0x2f03d00);
48
#endif
49

  
50
  parse_args(argc, argv);
51

  
52
  bug("Not implemented yet!");
26 53
}
client/client.h
1 1
/*
2 2
 *	BIRD Client
3 3
 *
4
 *	(c) 1999 Martin Mares <mj@ucw.cz>
4
 *	(c) 1999--2000 Martin Mares <mj@ucw.cz>
5 5
 *
6 6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7 7
 */
8

  
9
/* sysdep code */
10

  
11
int client_main(int argc, char **argv);
client/commands.c
1
/*
2
 *	BIRD Client -- Command Handling
3
 *
4
 *	(c) 1999--2000 Martin Mares <mj@ucw.cz>
5
 *
6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

  
9
#include "nest/bird.h"
10
#include "client/client.h"
11

  
12
struct cmd_info {
13
  char *command;
14
  char *args;
15
  char *help;
16
};
17

  
18
struct cmd_info command_table[] = {
19
#include "conf/commands.h"
20
};
client/util.c
1
/*
2
 *	BIRD Client -- Utility Functions
3
 *
4
 *	(c) 1999--2000 Martin Mares <mj@ucw.cz>
5
 *
6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

  
9
#include <stdio.h>
10
#include <string.h>
11
#include <stdlib.h>
12
#include <stdarg.h>
13

  
14
#include "nest/bird.h"
15
#include "client/client.h"
16

  
17
/* Client versions of logging functions */
18

  
19
void
20
bug(char *msg, ...)
21
{
22
  va_list args;
23

  
24
  va_start(args, msg);
25
  fputs("Internal error: ", stderr);
26
  vfprintf(stderr, msg, args);
27
  fputc('\n', stderr);
28
  exit(1);
29
}
30

  
31
void
32
die(char *msg, ...)
33
{
34
  va_list args;
35

  
36
  va_start(args, msg);
37
  vfprintf(stderr, msg, args);
38
  fputc('\n', stderr);
39
  exit(1);
40
}
configure.in
1 1
dnl ** This is a configure script template for BIRD
2 2
dnl ** Process it with autoconf to get ./configure
3
dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
3
dnl ** (c) 1999--2000 Martin Mares <mj@ucw.cz>
4 4

  
5 5
AC_REVISION($Id$)
6 6
AC_INIT(conf/confbase.Y)
7 7
AC_CONFIG_AUX_DIR(tools)
8 8

  
9 9
AC_ARG_ENABLE(debug,[  --enable-debug          enable internal debugging routines (default: enabled)],,enable_debug=yes)
10
AC_ARG_ENABLE(client,[  --enable-client         enable building of BIRD client (default: enabled)],,enable_client=yes)
10 11
AC_ARG_WITH(sysconfig,[  --with-sysconfig=FILE   use specified BIRD system configuration file])
11 12
AC_ARG_WITH(protocols,[  --with-protocols=LIST   include specified routing protocols (default: rip,static,pipe)],,[with_protocols="rip,static,pipe"])
12 13
AC_ARG_WITH(sysinclude,[  --with-sysinclude=PATH  search for system includes on specified place])
......
133 134
	AC_DEFINE_UNQUOTED(PATH_CONTROL_SOCKET_DIR, "$localstatedir")
134 135
fi
135 136

  
137
if test "$enable_client" = yes ; then
138
	CLIENT=client
139
else
140
	CLIENT=
141
fi
142
AC_SUBST(CLIENT)
143

  
136 144
mkdir -p $objdir/sysdep
137 145
AC_CONFIG_HEADER($objdir/sysdep/autoconf.h:sysdep/autoconf.h.in)
138 146
AC_OUTPUT_COMMANDS(,[CPP="$CPP" $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs])
......
146 154
	System configuration:	$sysdesc
147 155
	Debugging:		$enable_debug
148 156
	Routing protocols:	$protocols
157
	Client:			$enable_client
149 158
EOF
150 159
rm -f $objdir/.*-stamp
sysdep/unix/Modules
19 19
krt-set.c
20 20
krt-set.h
21 21
#endif
22

  
23
client-main.c
sysdep/unix/client-main.c
1
/*
2
 *	BIRD Client -- Unix Entry Point
3
 *
4
 *	(c) 1999 Martin Mares <mj@ucw.cz>
5
 *
6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

  
9
#include <stdio.h>
10
#include <string.h>
11
#include <stdlib.h>
12
#include <unistd.h>
13

  
14
#include "nest/bird.h"
15
#include "lib/resource.h"	/* For dmalloc */
16
#include "client/client.h"
17
#include "nest/cli.h"
18

  
19
#include "unix.h"
20

  
21
static char *opt_list = "";
22

  
23
static void
24
usage(void)
25
{
26
  fprintf(stderr, "Usage: birdc\n");
27
  exit(1);
28
}
29

  
30
static void
31
parse_args(int argc, char **argv)
32
{
33
  int c;
34

  
35
  while ((c = getopt(argc, argv, opt_list)) >= 0)
36
    switch (c)
37
      {
38
      default:
39
	usage();
40
      }
41
  if (optind < argc)
42
    usage();
43
}
44

  
45
void
46
cli_echo(unsigned int class, byte *buf)
47
{
48
}
49

  
50
int
51
client_main(int argc, char **argv)
52
{
53
#ifdef HAVE_LIBDMALLOC
54
  if (!getenv("DMALLOC_OPTIONS"))
55
    dmalloc_debug(0x2f03d00);
56
#endif
57

  
58
  parse_args(argc, argv);
59

  
60
  bug("Not implemented yet!");
61
}
tools/Makefile.in
1 1
# Makefile for the BIRD Internet Routing Daemon
2
# (c) 1999 Martin Mares <mj@ucw.cz>
2
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
3 3

  
4 4
include Rules
5 5

  
6 6
srcdir_abs := $(shell cd $(srcdir) ; pwd)
7 7

  
8
.PHONY: all subdir depend clean distclean tags
8
.PHONY: all daemon client subdir depend clean distclean tags
9 9

  
10
all: .dep-stamp subdir $(exedir)/bird $(exedir)/birdc
10
all: .dep-stamp subdir daemon @CLIENT@
11

  
12
daemon: $(exedir)/bird
13

  
14
client: $(exedir)/birdc
11 15

  
12 16
subdir depend: .dir-stamp
13 17
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done

Also available in: Unified diff