uci_blob.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. int n_next;
  26. const struct uci_blob_param_list *next[];
  27. };
  28. int uci_to_blob(struct blob_buf *b, struct uci_section *s,
  29. const struct uci_blob_param_list *p);
  30. bool uci_blob_check_equal(struct blob_attr *c1, struct blob_attr *c2,
  31. const struct uci_blob_param_list *config);
  32. bool uci_blob_diff(struct blob_attr **tb1, struct blob_attr **tb2,
  33. const struct uci_blob_param_list *config,
  34. unsigned long *diff_bits);
  35. #endif