File: tlv.py

package info (click to toggle)
python-pcs 0.5%2Bdebian-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 676 kB
  • ctags: 648
  • sloc: python: 2,528; makefile: 63
file content (15 lines) | stat: -rw-r--r-- 281 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sys
sys.path.append('../src')

import pcs

def main():
    t = pcs.Field("type", 8)
    l = pcs.Field("length", 8)
    v = pcs.Field("value", 255, type = str)
    tlv = pcs.Packet([t, l, v])
    tlv.type = 5
    tlv.length = 4
    tlv.value = "foo"
    print tlv.bytes