tm_get_sband_dbg_cb.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. function tm_get_sband_dbg_cb(buffer, pinfo, tree, sband_dbg_cb, offset)
  2. -- Define ProtoFields
  3. local f_state = ProtoField.uint8("sband_dbg_cb.state", "State", base.DEC)
  4. local f_sch_gs_cont = ProtoField.uint8("sband_dbg_cb.sband_sch_gs_cont", "Scheduler Ground Station Contact", base.DEC)
  5. local f_gs_cont_valid = ProtoField.uint8("sband_dbg_cb.sband_gs_cont_valid", "Ground Station Contact Valid", base.DEC)
  6. local f_udp_rx_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_rx_cnt", "UDP RX Count", base.DEC)
  7. local f_udp_tx_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_cnt", "UDP TX Count", base.DEC)
  8. local f_udp_rx_less_len_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_rx_less_len_cnt", "UDP RX Less Length Count", base.DEC)
  9. local f_udp_tx_send_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_send_fail_cnt", "UDP TX Send Fail Count", base.DEC)
  10. local f_udp_tx_pkt_drop_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_pkt_drop_cnt", "UDP TX Packet Drop Count", base.DEC)
  11. local f_udp_tx_len_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_len_fail_cnt", "UDP TX Length Fail Count", base.DEC)
  12. local f_udp_tx_crc_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_crc_fail_cnt", "UDP TX CRC Fail Count", base.DEC)
  13. local f_udp_tx_busy_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_busy_fail_cnt", "UDP TX Busy Fail Count", base.DEC)
  14. local f_udp_tx_fifo_full_cnt = ProtoField.uint32("sband_dbg_cb.sband_udp_tx_fifo_full_cnt", "UDP TX FIFO Full Count", base.DEC)
  15. local f_tcp_read_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_tcp_read_fail_cnt", "TCP Read Fail Count", base.DEC)
  16. local f_tcp_conn_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_tcp_conn_fail_cnt", "TCP Connection Fail Count", base.DEC)
  17. local f_tcp_write_fail_cnt = ProtoField.uint32("sband_dbg_cb.sband_tcp_write_fail_cnt", "TCP Write Fail Count", base.DEC)
  18. local f_tcp_read_busy_cnt = ProtoField.uint32("sband_dbg_cb.sband_tcp_read_busy_cnt", "TCP Read Busy Count", base.DEC)
  19. local f_rx_swt_cnt = ProtoField.uint32("sband_dbg_cb.sband_rx_swt_cnt", "RX Switch Count", base.DEC)
  20. -- Register the fields in the protocol
  21. sband_dbg_cb.fields = {
  22. f_state,
  23. f_sch_gs_cont,
  24. f_gs_cont_valid,
  25. f_udp_rx_cnt,
  26. f_udp_tx_cnt,
  27. f_udp_rx_less_len_cnt,
  28. f_udp_tx_send_fail_cnt,
  29. f_udp_tx_pkt_drop_cnt,
  30. f_udp_tx_len_fail_cnt,
  31. f_udp_tx_crc_fail_cnt,
  32. f_udp_tx_busy_fail_cnt,
  33. f_udp_tx_fifo_full_cnt,
  34. f_tcp_read_fail_cnt,
  35. f_tcp_conn_fail_cnt,
  36. f_tcp_write_fail_cnt,
  37. f_tcp_read_busy_cnt,
  38. f_rx_swt_cnt
  39. }
  40. -- Create a subtree for the structure
  41. local subtree = tree:add(sband_dbg_cb, buffer(), "TM SBAND GET DBG CB INFO")
  42. -- Dissect the fields
  43. subtree:add_le(f_state, buffer(offset, 1):le_uint())
  44. offset = offset + 1
  45. subtree:add_le(f_sch_gs_cont, buffer(offset, 1):le_uint())
  46. offset = offset + 1
  47. subtree:add_le(f_gs_cont_valid, buffer(offset, 1):le_uint())
  48. offset = offset + 1
  49. subtree:add_le(f_udp_rx_cnt, buffer(offset, 4):le_uint())
  50. offset = offset + 4
  51. subtree:add_le(f_udp_tx_cnt, buffer(offset, 4):le_uint())
  52. offset = offset + 4
  53. subtree:add_le(f_udp_rx_less_len_cnt, buffer(offset, 4):le_uint())
  54. offset = offset + 4
  55. subtree:add_le(f_udp_tx_send_fail_cnt, buffer(offset, 4):le_uint())
  56. offset = offset + 4
  57. subtree:add_le(f_udp_tx_pkt_drop_cnt, buffer(offset, 4):le_uint())
  58. offset = offset + 4
  59. subtree:add_le(f_udp_tx_len_fail_cnt, buffer(offset, 4):le_uint())
  60. offset = offset + 4
  61. subtree:add_le(f_udp_tx_crc_fail_cnt, buffer(offset, 4):le_uint())
  62. offset = offset + 4
  63. subtree:add_le(f_udp_tx_busy_fail_cnt, buffer(offset, 4):le_uint())
  64. offset = offset + 4
  65. subtree:add_le(f_udp_tx_fifo_full_cnt, buffer(offset, 4):le_uint())
  66. offset = offset + 4
  67. subtree:add_le(f_tcp_read_fail_cnt, buffer(offset, 4):le_uint())
  68. offset = offset + 4
  69. subtree:add_le(f_tcp_conn_fail_cnt, buffer(offset, 4):le_uint())
  70. offset = offset + 4
  71. subtree:add_le(f_tcp_write_fail_cnt, buffer(offset, 4):le_uint())
  72. offset = offset + 4
  73. subtree:add_le(f_tcp_read_busy_cnt, buffer(offset, 4):le_uint())
  74. offset = offset + 4
  75. subtree:add_le(f_rx_swt_cnt, buffer(offset, 4):le_uint())
  76. offset = offset + 4
  77. end