sr_copypaste.c 1.9 KB

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