uci_blob.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * blob.c - uci <-> blobmsg conversion layer
  3. * Copyright (C) 2012-2013 Felix Fietkau <nbd@openwrt.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License version 2.1
  7. * as published by the Free Software Foundation
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. */
  14. #ifndef __UCI_BLOB_H
  15. #define __UCI_BLOB_H
  16. #include <libubox/blobmsg.h>
  17. #include "uci.h"
  18. struct uci_blob_param_info {
  19. enum blobmsg_type type;
  20. };
  21. struct uci_blob_param_list {
  22. int n_params;
  23. const struct blobmsg_policy *params;
  24. const struct uci_blob_param_info *info;
  25. const char * const *validate;
  26. int n_next;
  27. const struct uci_blob_param_list *next[];
  28. };
  29. int uci_to_blob(struct blob_buf *b, struct uci_section *s,
  30. const struct uci_blob_param_list *p);
  31. bool uci_blob_check_equal(struct blob_attr *c1, struct blob_attr *c2,
  32. const struct uci_blob_param_list *config);
  33. bool uci_blob_diff(struct blob_attr **tb1, struct blob_attr **tb2,
  34. const struct uci_blob_param_list *config,
  35. unsigned long *diff_bits);
  36. #endif