Advertisement
Borik

Untitled

Apr 21st, 2025
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.62 KB | None | 0 0
  1. package libnas
  2.  
  3. import (
  4.     "log"
  5.     "reflect"
  6. )
  7.  
  8. type TEpsQoS struct {
  9.     QCI                        byte
  10.     MBRUp, MBRDn, GBRUp, GBRDn uint64
  11. }
  12.  
  13. func (qos *TEpsQoS) Value() (res []byte) {
  14.     res = append(res, qos.QCI)
  15.     if qos.MBRUp == 0 && qos.MBRDn == 0 && qos.GBRUp == 0 && qos.GBRDn == 0 {
  16.         return
  17.     }
  18.     // todo implement of MBR&GBR coding here
  19.     return
  20. }
  21.  
  22. func (qos *TEpsQoS) Set(a any) {
  23.     if z, ok := a.([]byte); !ok {
  24.         log.Printf("TEpsQos accepting only slices as input for unmarshal but %s found", reflect.TypeOf(a).String())
  25.     } else {
  26.         qos.QCI = z[0]
  27.         // todo implement decoding MBR&GBR here
  28.     }
  29.     return
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement