From 126c6f06bf1a8d23989cc04bfe758a5ca2bed792 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Thu, 25 Jun 2015 21:22:20 +0200 Subject: [PATCH] s3-rpcclient: use witness defines in witness rpcclient. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Guenther Signed-off-by: Günther Deschner Reviewed-by: Stefan Metzmacher --- source3/rpcclient/cmd_witness.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/source3/rpcclient/cmd_witness.c b/source3/rpcclient/cmd_witness.c index fa6f5bb411a..bebfb4d084a 100644 --- a/source3/rpcclient/cmd_witness.c +++ b/source3/rpcclient/cmd_witness.c @@ -309,12 +309,6 @@ done: return result; } -enum { - RESOURCE_STATE_UNKNOWN = 0x00, - RESOURCE_STATE_AVAILABLE = 0x01, - RESOURCE_STATE_UNAVAILABLE = 0xff -}; - static bool AsyncNotify_Change(TALLOC_CTX *mem_ctx, const uint8_t **ptr) { const uint8_t *pos = *ptr; @@ -329,11 +323,11 @@ static bool AsyncNotify_Change(TALLOC_CTX *mem_ctx, const uint8_t **ptr) return false; } - if (type == RESOURCE_STATE_UNKNOWN) { + if (type == WITNESS_RESOURCE_STATE_UNKNOWN) { type_str = "Unknown"; - } else if(type == RESOURCE_STATE_AVAILABLE) { + } else if(type == WITNESS_RESOURCE_STATE_AVAILABLE) { type_str = "Available\n"; - } else if(type == RESOURCE_STATE_UNAVAILABLE) { + } else if(type == WITNESS_RESOURCE_STATE_UNAVAILABLE) { type_str = "Unavailable"; } else { type_str = talloc_asprintf(name, "Invalid (%u)", type); @@ -345,13 +339,6 @@ static bool AsyncNotify_Change(TALLOC_CTX *mem_ctx, const uint8_t **ptr) return true; } -enum { - IPADDR_V4 = 0x01, - IPADDR_V6 = 0x02, - IPADDR_ONLINE = 0x08, - IPADDR_OFFLINE = 0x10, -}; - /* IPADDR_INFO_LIST */ static bool AsyncNotify_Move(TALLOC_CTX *mem_ctx, const uint8_t **ptr) { @@ -391,16 +378,16 @@ static bool AsyncNotify_Move(TALLOC_CTX *mem_ctx, const uint8_t **ptr) pos += 16; d_printf("Flags 0x%08x", flags); - if (flags & IPADDR_V4) { + if (flags & WITNESS_IPADDR_V4) { d_printf(" %s", str4); } - if (flags & IPADDR_V6) { + if (flags & WITNESS_IPADDR_V6) { d_printf(" %s", str6); } - if (flags & IPADDR_ONLINE) { + if (flags & WITNESS_IPADDR_ONLINE) { d_printf(" Online"); } - if (flags & IPADDR_ONLINE) { + if (flags & WITNESS_IPADDR_ONLINE) { d_printf(" Offline"); } d_printf("\n"); -- 2.11.4.GIT