sch.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ischeme_t sch = {
  2. PLUGIN_LIST
  3. PLUGIN {
  4. .name = "klish",
  5. },
  6. PLUGIN {
  7. .name = "base",
  8. .id = "klish",
  9. .file = "kplugin_klish.so",
  10. },
  11. END_PLUGIN_LIST,
  12. PTYPE_LIST
  13. PTYPE {
  14. .name = "ptype1",
  15. .help = "help1",
  16. ACTION_LIST
  17. ACTION {
  18. .sym = "nop",
  19. .script = "cat /etc/passwd",
  20. },
  21. ACTION {
  22. .sym = "nop@base",
  23. .script = "cat /etc/group",
  24. },
  25. END_ACTION_LIST,
  26. },
  27. PTYPE {
  28. .name = "ptype2",
  29. .help = "help2",
  30. },
  31. END_PTYPE_LIST,
  32. VIEW_LIST
  33. VIEW {
  34. .name = "view1",
  35. COMMAND_LIST
  36. COMMAND {
  37. .name = "command1",
  38. .help = "help1",
  39. },
  40. COMMAND {
  41. .name = "command2",
  42. .help = "help1",
  43. },
  44. COMMAND {
  45. .name = "command3",
  46. .help = "help1",
  47. },
  48. END_COMMAND_LIST,
  49. },
  50. VIEW {
  51. .name = "view2",
  52. },
  53. VIEW {
  54. .name = "view1",
  55. COMMAND_LIST
  56. COMMAND {
  57. .name = "command4",
  58. .help = "help1",
  59. },
  60. COMMAND {
  61. .name = "command5",
  62. .help = "help1",
  63. PARAM_LIST
  64. PARAM {
  65. .name = "param1",
  66. .help = "helpparam1",
  67. .ptype = "ptype1",
  68. },
  69. PARAM {
  70. .name = "param2",
  71. .help = "helpparam2",
  72. .ptype = "ptype2",
  73. PARAM_LIST
  74. PARAM {
  75. .name = "param3",
  76. .help = "helpparam1",
  77. .ptype = "ptype1",
  78. },
  79. PARAM {
  80. .name = "param4",
  81. .help = "helpparam2",
  82. .ptype = "ptype2",
  83. },
  84. END_PARAM_LIST,
  85. },
  86. END_PARAM_LIST,
  87. ACTION_LIST
  88. ACTION {
  89. .sym = "nop@klish",
  90. .script = "cat /etc/passwd",
  91. },
  92. ACTION {
  93. .sym = "nop",
  94. .script = "cat /etc/group",
  95. },
  96. END_ACTION_LIST,
  97. },
  98. END_COMMAND_LIST,
  99. },
  100. //VIEW {
  101. // },
  102. END_VIEW_LIST,
  103. };