feat: Working impl with offer / ack

This commit is contained in:
Adrian Rumpold
2022-02-06 12:14:50 +01:00
parent ed6198f71a
commit 9f83d6f3f5
7 changed files with 1307 additions and 53 deletions

20
options.go Normal file
View File

@@ -0,0 +1,20 @@
package main
type Option struct {
Code OptionCode
Data []byte
}
func (o Option) Size() uint8 {
if len(o.Data) > 0 {
return uint8(o.Data[0])
}
return 0
}
type Options map[OptionCode]Option
func (opts Options) HasOption(code OptionCode) bool {
_, exists := opts[code]
return exists
}