sr_copypaste.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <assert.h>
  5. #include <sysrepo.h>
  6. #include <sysrepo/xpath.h>
  7. #include "private.h"
  8. static int
  9. sr_ly_module_is_internal(const struct lys_module *ly_mod)
  10. {
  11. if (!ly_mod->revision) {
  12. return 0;
  13. }
  14. if (!strcmp(ly_mod->name, "ietf-yang-metadata") && !strcmp(ly_mod->revision, "2016-08-05")) {
  15. return 1;
  16. } else if (!strcmp(ly_mod->name, "yang") && !strcmp(ly_mod->revision, "2021-04-07")) {
  17. return 1;
  18. } else if (!strcmp(ly_mod->name, "ietf-inet-types") && !strcmp(ly_mod->revision, "2013-07-15")) {
  19. return 1;
  20. } else if (!strcmp(ly_mod->name, "ietf-yang-types") && !strcmp(ly_mod->revision, "2013-07-15")) {
  21. return 1;
  22. }
  23. return 0;
  24. }
  25. int
  26. sr_module_is_internal(const struct lys_module *ly_mod)
  27. {
  28. if (!ly_mod->revision) {
  29. return 0;
  30. }
  31. if (sr_ly_module_is_internal(ly_mod)) {
  32. return 1;
  33. }
  34. if (!strcmp(ly_mod->name, "ietf-datastores") && !strcmp(ly_mod->revision, "2018-02-14")) {
  35. return 1;
  36. } else if (!strcmp(ly_mod->name, "ietf-yang-schema-mount")) {
  37. return 1;
  38. } else if (!strcmp(ly_mod->name, "ietf-yang-library")) {
  39. return 1;
  40. } else if (!strcmp(ly_mod->name, "ietf-netconf")) {
  41. return 1;
  42. } else if (!strcmp(ly_mod->name, "ietf-netconf-with-defaults") && !strcmp(ly_mod->revision, "2011-06-01")) {
  43. return 1;
  44. } else if (!strcmp(ly_mod->name, "ietf-origin") && !strcmp(ly_mod->revision, "2018-02-14")) {
  45. return 1;
  46. } else if (!strcmp(ly_mod->name, "ietf-netconf-notifications") && !strcmp(ly_mod->revision, "2012-02-06")) {
  47. return 1;
  48. } else if (!strcmp(ly_mod->name, "sysrepo")) {
  49. return 1;
  50. } else if (!strcmp(ly_mod->name, "sysrepo-monitoring")) {
  51. return 1;
  52. } else if (!strcmp(ly_mod->name, "sysrepo-plugind")) {
  53. return 1;
  54. } else if (!strcmp(ly_mod->name, "ietf-netconf-acm")) {
  55. return 1;
  56. }
  57. return 0;
  58. }