app_client_set.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright [2021] JD.com, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. #ifndef CONFIG_CENTER_CLIENT_H_INCLUDED_
  18. #define CONFIG_CENTER_CLIENT_H_INCLUDED_
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <stdint.h>
  22. #include <stddef.h>
  23. #include <memory.h>
  24. #define IP_LEN 16
  25. typedef struct ip_node {
  26. int bid;
  27. int port;
  28. int status;
  29. int weight;
  30. char ip[IP_LEN];
  31. } IP_NODE;
  32. typedef struct ip_route {
  33. int ip_num;
  34. IP_NODE *ip_list;
  35. } IP_ROUTE;
  36. int get_version(uint64_t *version);
  37. int dump_ca_shm();
  38. int get_ip_route(int bid, IP_ROUTE *ip_route);
  39. int free_ip_route(IP_ROUTE *ip_route);
  40. #endif