insert an item in the table for the provided packet and packet metadata.
(pkt []byte, srcAddrOffset, dstAddrOffset, tcphOffset, tcphLen, bufsIndex int)
| 110 | |
| 111 | // insert an item in the table for the provided packet and packet metadata. |
| 112 | func (t *tcpGROTable) insert(pkt []byte, srcAddrOffset, dstAddrOffset, tcphOffset, tcphLen, bufsIndex int) { |
| 113 | key := newTCPFlowKey(pkt, srcAddrOffset, dstAddrOffset, tcphOffset) |
| 114 | item := tcpGROItem{ |
| 115 | key: key, |
| 116 | bufsIndex: uint16(bufsIndex), |
| 117 | gsoSize: uint16(len(pkt[tcphOffset+tcphLen:])), |
| 118 | iphLen: uint8(tcphOffset), |
| 119 | tcphLen: uint8(tcphLen), |
| 120 | sentSeq: binary.BigEndian.Uint32(pkt[tcphOffset+4:]), |
| 121 | pshSet: pkt[tcphOffset+tcpFlagsOffset]&tcpFlagPSH != 0, |
| 122 | } |
| 123 | items, ok := t.itemsByFlow[key] |
| 124 | if !ok { |
| 125 | items = t.newItems() |
| 126 | } |
| 127 | items = append(items, item) |
| 128 | t.itemsByFlow[key] = items |
| 129 | } |
| 130 | |
| 131 | func (t *tcpGROTable) updateAt(item tcpGROItem, i int) { |
| 132 | items, _ := t.itemsByFlow[item.key] |
no test coverage detected