Commit eeba61cc authored by Ondrej Zajicek (work)'s avatar Ondrej Zajicek (work)
Browse files

Minor cleanups

parent 5e8df049
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -957,7 +957,7 @@ fragment_val_str(u8 val)
  return "???";
}

static int
static uint
net_format_flow(char *buf, uint blen, const byte *data, uint dlen, int ipv6)
{
  buffer b = {
@@ -1125,7 +1125,7 @@ net_format_flow(char *buf, uint blen, const byte *data, uint dlen, int ipv6)
 * of written chars. If final string is too large, the string will ends the with
 * ' ...}' sequence and zero-terminator.
 */
int
uint
flow4_net_format(char *buf, uint blen, const net_addr_flow4 *f)
{
  return net_format_flow(buf, blen, f->data, f->length - sizeof(net_addr_flow4), 0);
@@ -1141,7 +1141,7 @@ flow4_net_format(char *buf, uint blen, const net_addr_flow4 *f)
 * of written chars. If final string is too large, the string will ends the with
 * ' ...}' sequence and zero-terminator.
 */
int
uint
flow6_net_format(char *buf, uint blen, const net_addr_flow6 *f)
{
  return net_format_flow(buf, blen, f->data, f->length - sizeof(net_addr_flow6), 1);
+2 −2
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ void flow6_validate_cf(net_addr_flow6 *f);
 * 	Net Formatting
 */

int flow4_net_format(char *buf, uint blen, const net_addr_flow4 *f);
int flow6_net_format(char *buf, uint blen, const net_addr_flow6 *f);
uint flow4_net_format(char *buf, uint blen, const net_addr_flow4 *f);
uint flow6_net_format(char *buf, uint blen, const net_addr_flow6 *f);

#endif /* _BIRD_FLOWSPEC_H_ */
+3 −8
Original line number Diff line number Diff line
@@ -30,20 +30,17 @@ t_read_length(void)
{
  byte data[] = { 0xcc, 0xcc, 0xcc };

  u16 get;
  u16 expect;

  for (uint expect = 0; expect < 0xf0; expect++)
  {
    *data = expect;
    get = flow_read_length(data);
    uint get = flow_read_length(data);
    bt_assert_msg(get == expect, "Testing get length 0x%02x (get 0x%02x)", expect, get);
  }

  for (uint expect = 0; expect <= 0xfff; expect++)
  {
    put_u16(data, expect | 0xf000);
    get = flow_read_length(data);
    uint get = flow_read_length(data);
    bt_assert_msg(get == expect, "Testing get length 0x%03x (get 0x%03x)", expect, get);
  }

@@ -54,12 +51,10 @@ static int
t_write_length(void)
{
  byte data[] = { 0xcc, 0xcc, 0xcc };
  uint offset;
  byte *c;

  for (uint expect = 0; expect <= 0xfff; expect++)
  {
    offset = flow_write_length(data, expect);
    uint offset = flow_write_length(data, expect);

    uint set = (expect < 0xf0) ? *data : (get_u16(data) & 0x0fff);
    bt_assert_msg(set == expect, "Testing set length 0x%03x (set 0x%03x)", expect, set);
+2 −0
Original line number Diff line number Diff line
@@ -2,3 +2,5 @@ src := babel.c packets.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)

tests_objs := $(tests_objs) $(src-o-files)
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -2,3 +2,5 @@ src := rpki.c packets.c tcp_transport.c ssh_transport.c transport.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)

tests_objs := $(tests_objs) $(src-o-files)
 No newline at end of file
Loading