Commit b12daceb authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka
Browse files

Client: explicit end of symbol dump

parent b5e9fe3e
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -366,6 +366,7 @@ process_internal_message(int reply_code, const char *name)
      welcomed = 1;
      printf("BIRD %s ready.\n", name);
    }
    symread = 1;
    return;

  case RC_NOTIFY:
@@ -382,15 +383,17 @@ process_internal_message(int reply_code, const char *name)
  case RC_TABLE_NAME:		flag = CLI_SF_TABLE; break;
  case RC_TEMPLATE_NAME:	flag = CLI_SF_TEMPLATE; break;
  case RC_INTERFACE_NAME:	flag = CLI_SF_INTERFACE; break;
  case RC_DUMP_DONE:		symread = 0; return;
  default:
    printf("Undefined %d: %s", reply_code, name);
    return;
  }

  if (flag && name && *name) {
    symread = 1;
  if (flag && name && *name)
    if (symread)
      add_to_symbols(flag, name);
  }
    else
      printf("Unexpected symbol definition %d: %s", reply_code, name);
}

#define PRINTF(LEN, PARGS...) do { if (!skip_input && !complete) len = printf(PARGS); } while(0)
@@ -419,8 +422,7 @@ server_got_reply(char *x)
      else if (code)
      {
	PRINTF(len, "%s\n", verbose ? x : x+5);
      } else if (symread)
	symread = 0;
      }

      if (x[4] == ' ')
      {
+3 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ enum reply_code {
  RC_SHOW_RIP_INTERFACE = 1021,
  RC_SHOW_RIP_NEIGHBORS = 1022,

  RC_BIRD_VERSION_NUM = 3000,
  RC_BIRD_VERSION_NUM = 3000,   /* This begins the symbol dump */
  RC_TABLE_NAME = 3001,
  RC_PROTOCOL_NAME = 3002,
  RC_FILTER_NAME = 3003,
@@ -82,7 +82,8 @@ enum reply_code {
  RC_VARIABLE_NAME = 3006,
  RC_TEMPLATE_NAME = 3007,
  RC_INTERFACE_NAME = 3008,
  RC_NOTIFY = 3009, 		/* Daemon notifies the client about new symbol set */
  RC_DUMP_DONE = 3009,		/* This ends the symbol dump */
  RC_NOTIFY = 3010, 		/* Daemon notifies the client about new symbol set */

  RC_REPLY_TOO_LONG = 8000,
  RC_ROUTE_NOT_FOUND = 8001,
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ cmd_send_symbols(void)
    if (!(i->flags & IF_SHUTDOWN))
      cli_msg(RC_INTERFACE_NAME, "\"%s\"", i->name);

  cli_msg(0, "");
  cli_msg(RC_DUMP_DONE, "");
}

static void