diff --git a/sandesh/library/c/protocol/thrift_binary_protocol.c b/sandesh/library/c/protocol/thrift_binary_protocol.c index 4e4e06f2..fe1b405d 100644 --- a/sandesh/library/c/protocol/thrift_binary_protocol.c +++ b/sandesh/library/c/protocol/thrift_binary_protocol.c @@ -284,7 +284,7 @@ thrift_binary_protocol_write_ipaddr (ThriftProtocol *protocol, } int32_t -thrift_binary_protocol_write_uuid_t (ThriftProtocol *protocol, const ct_uuid_t value, +thrift_binary_protocol_write_uuid_t (ThriftProtocol *protocol, const uuid_t value, int *error) { if (thrift_transport_write (protocol->transport, @@ -650,7 +650,7 @@ thrift_binary_protocol_read_ipaddr (ThriftProtocol *protocol, ipaddr_t *value, } int32_t -thrift_binary_protocol_read_uuid_t (ThriftProtocol *protocol, ct_uuid_t *value, +thrift_binary_protocol_read_uuid_t (ThriftProtocol *protocol, uuid_t *value, int *error) { int32_t ret; diff --git a/sandesh/library/c/protocol/thrift_protocol.c b/sandesh/library/c/protocol/thrift_protocol.c index ee50b785..b7c1f7ff 100644 --- a/sandesh/library/c/protocol/thrift_protocol.c +++ b/sandesh/library/c/protocol/thrift_protocol.c @@ -106,7 +106,7 @@ thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, int *error) } case T_UUID: { - ct_uuid_t uuid; + uuid_t uuid; return thrift_protocol_read_uuid_t (protocol, &uuid, error); } case T_STRUCT: diff --git a/sandesh/library/c/protocol/thrift_protocol.h b/sandesh/library/c/protocol/thrift_protocol.h index 22e42730..3bd448c7 100644 --- a/sandesh/library/c/protocol/thrift_protocol.h +++ b/sandesh/library/c/protocol/thrift_protocol.h @@ -131,7 +131,7 @@ struct _ThriftProtocol const u_int32_t len, int *error); int32_t (*write_xml) (struct _ThriftProtocol *protocol, const char *str, int *error); - int32_t (*write_uuid_t) (struct _ThriftProtocol *protocol, const ct_uuid_t value, + int32_t (*write_uuid_t) (struct _ThriftProtocol *protocol, const uuid_t value, int *error); int32_t (*read_sandesh_begin) (struct _ThriftProtocol *protocol, char **name, @@ -164,7 +164,7 @@ struct _ThriftProtocol int32_t (*read_binary) (struct _ThriftProtocol *protocol, void **buf, u_int32_t *len, int *error); int32_t (*read_xml) (struct _ThriftProtocol *protocol, char **str, int *error); - int32_t (*read_uuid_t) (struct _ThriftProtocol *protocol, ct_uuid_t *value, int *error); + int32_t (*read_uuid_t) (struct _ThriftProtocol *protocol, uuid_t *value, int *error); }; typedef struct _ThriftProtocol ThriftProtocol; @@ -344,7 +344,7 @@ static inline int32_t thrift_protocol_write_xml (ThriftProtocol *protocol, } static inline int32_t thrift_protocol_write_uuid_t (ThriftProtocol *protocol, - const ct_uuid_t value, + const uuid_t value, int *error) { return protocol->write_uuid_t (protocol, value, error); @@ -508,7 +508,7 @@ static inline int32_t thrift_protocol_read_xml (ThriftProtocol *protocol, } static inline int32_t thrift_protocol_read_uuid_t (ThriftProtocol *protocol, - ct_uuid_t *value, int *error) + uuid_t *value, int *error) { return protocol->read_uuid_t (protocol, value, error); } diff --git a/sandesh/library/c/sandesh.h b/sandesh/library/c/sandesh.h index c6a8a08e..fc23a190 100644 --- a/sandesh/library/c/sandesh.h +++ b/sandesh/library/c/sandesh.h @@ -125,7 +125,7 @@ typedef UINT32 uint32_t, u_int32_t; typedef UINT64 uint64_t, u_int64_t; #endif -typedef unsigned char ct_uuid_t[16]; +typedef unsigned char uuid_t[16]; typedef struct ipaddr_s { uint8_t iptype; // AF_INET or AF_INET6 diff --git a/sandesh/library/c/test/sandesh_c_test.cc b/sandesh/library/c/test/sandesh_c_test.cc index f61af3b1..d427cb79 100644 --- a/sandesh/library/c/test/sandesh_c_test.cc +++ b/sandesh/library/c/test/sandesh_c_test.cc @@ -55,7 +55,7 @@ static uint32_t inner_f(4294967295u); static uint64_t inner_g(18446744073709551615ull); static std::string inner_h("abc"); static uint32_t inner_i(4294967295u); -static ct_uuid_t inner_j = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, +static uuid_t inner_j = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; static std::string inner_k("20.1.1.2"); static std::string inner_l("2001:abce::4"); @@ -93,7 +93,7 @@ static void ValidateAbcInner(abc_inner *inner) { EXPECT_STREQ(inner->inner_h, inner_h.c_str()); EXPECT_EQ(inner->inner_i, inner_i); EXPECT_EQ(0, memcmp(inner->inner_j, - inner_j, sizeof(ct_uuid_t))); + inner_j, sizeof(uuid_t))); ipaddr_t inner_k_v4; inner_k_v4.iptype = AF_INET; int success(inet_pton(AF_INET, inner_k.c_str(), &inner_k_v4.ipv4)); @@ -135,7 +135,7 @@ static void CompareAbcInner(abc_inner *actual, abc_inner *expected) { EXPECT_STREQ(actual->inner_h, expected->inner_h); EXPECT_EQ(actual->inner_i, expected->inner_i); EXPECT_EQ(0, memcmp(actual->inner_j, - expected->inner_j, sizeof(ct_uuid_t))); + expected->inner_j, sizeof(uuid_t))); EXPECT_EQ(actual->inner_k.iptype, expected->inner_k.iptype); EXPECT_EQ(0, memcmp(&actual->inner_k.ipv4, &expected->inner_k.ipv4, 4)); @@ -496,7 +496,7 @@ abc_sandesh_process (void *pabc) { void buffer_test_process (void *ptr) { int i; - ct_uuid_t uuid_value = + uuid_t uuid_value = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; BufferTest *psandesh = (BufferTest *)ptr; @@ -507,18 +507,18 @@ buffer_test_process (void *ptr) { for (i = 0; i < 5; i++) { EXPECT_EQ(psandesh->listElem1[i], i); EXPECT_EQ(psandesh->listElem2[i], i); - ct_uuid_t uuid_temp = + uuid_t uuid_temp = {0x00+i,0x00+i,0x01+i,0x01+i,0x02+i,0x02+i,0x03+i,0x03+i, 0x04+i,0x04+i,0x05+i,0x05+i,0x06+i,0x06+i,0x07+i,0x07+i}; EXPECT_EQ(0, memcmp(psandesh->listElem3[i], - uuid_temp, sizeof(ct_uuid_t))); + uuid_temp, sizeof(uuid_t))); } EXPECT_EQ(psandesh->u16Elem1, 65535); EXPECT_EQ(psandesh->u32Elem1, 4294967295u); EXPECT_EQ(psandesh->u64Elem1, 18446744073709551615ull); EXPECT_STREQ(psandesh->xmlElem1, "xmlElem1"); EXPECT_EQ(psandesh->ipv4Elem1, 4294967295u); - EXPECT_EQ(0, memcmp(psandesh->uuidElem1, uuid_value, sizeof(ct_uuid_t))); + EXPECT_EQ(0, memcmp(psandesh->uuidElem1, uuid_value, sizeof(uuid_t))); ipaddr_t ipaddr1; inet_pton(AF_INET, "11.11.11.3", &ipaddr1.ipv4); EXPECT_EQ(psandesh->ipaddrElem1.iptype, AF_INET); diff --git a/sandesh/library/c/test/sandesh_c_test.sandesh b/sandesh/library/c/test/sandesh_c_test.sandesh index 67763fd6..dc4b025d 100644 --- a/sandesh/library/c/test/sandesh_c_test.sandesh +++ b/sandesh/library/c/test/sandesh_c_test.sandesh @@ -24,7 +24,7 @@ struct abc_inner { 7:u64 inner_g; 8:xml inner_h; 9:ipv4 inner_i; - 10:ct_uuid_t inner_j; + 10:uuid_t inner_j; 11:ipaddr inner_k; 12:ipaddr inner_l; 13:string inner_m;