|
| 1 | +/* |
| 2 | + Copyright NetFoundry Inc. |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package xgress |
| 18 | + |
| 19 | +type CircuitInspectDetail struct { |
| 20 | + CircuitId string `json:"circuitId"` |
| 21 | + Forwards map[string]string `json:"forwards"` |
| 22 | + XgressDetails map[string]*InspectDetail `json:"xgressDetails"` |
| 23 | + LinkDetails map[string]*LinkInspectDetail `json:"linkDetails"` |
| 24 | + includeGoroutines bool |
| 25 | +} |
| 26 | + |
| 27 | +func (self *CircuitInspectDetail) SetIncludeGoroutines(includeGoroutines bool) { |
| 28 | + self.includeGoroutines = includeGoroutines |
| 29 | +} |
| 30 | + |
| 31 | +func (self *CircuitInspectDetail) IncludeGoroutines() bool { |
| 32 | + return self.includeGoroutines |
| 33 | +} |
| 34 | + |
| 35 | +func (self *CircuitInspectDetail) AddXgressDetail(xgressDetail *InspectDetail) { |
| 36 | + self.XgressDetails[xgressDetail.Address] = xgressDetail |
| 37 | +} |
| 38 | + |
| 39 | +func (self *CircuitInspectDetail) AddLinkDetail(linkDetail *LinkInspectDetail) { |
| 40 | + self.LinkDetails[linkDetail.Id] = linkDetail |
| 41 | +} |
| 42 | + |
| 43 | +type InspectDetail struct { |
| 44 | + Address string `json:"address"` |
| 45 | + Originator string `json:"originator"` |
| 46 | + TimeSinceLastLinkRx string `json:"timeSinceLastLinkRx"` |
| 47 | + SendBufferDetail *SendBufferDetail `json:"sendBufferDetail"` |
| 48 | + RecvBufferDetail *RecvBufferDetail `json:"recvBufferDetail"` |
| 49 | + XgressPointer string `json:"xgressPointer"` |
| 50 | + LinkSendBufferPointer string `json:"linkSendBufferPointer"` |
| 51 | + Goroutines []string `json:"goroutines"` |
| 52 | + Sequence uint64 `json:"sequence"` |
| 53 | + Flags string `json:"flags"` |
| 54 | +} |
| 55 | + |
| 56 | +type SendBufferDetail struct { |
| 57 | + WindowSize uint32 `json:"windowSize"` |
| 58 | + LinkSendBufferSize uint32 `json:"linkSendBufferSize"` |
| 59 | + LinkRecvBufferSize uint32 `json:"linkRecvBufferSize"` |
| 60 | + Accumulator uint32 `json:"accumulator"` |
| 61 | + SuccessfulAcks uint32 `json:"successfulAcks"` |
| 62 | + DuplicateAcks uint32 `json:"duplicateAcks"` |
| 63 | + Retransmits uint32 `json:"retransmits"` |
| 64 | + Closed bool `json:"closed"` |
| 65 | + BlockedByLocalWindow bool `json:"blockedByLocalWindow"` |
| 66 | + BlockedByRemoteWindow bool `json:"blockedByRemoteWindow"` |
| 67 | + RetxScale float64 `json:"retxScale"` |
| 68 | + RetxThreshold uint32 `json:"retxThreshold"` |
| 69 | + TimeSinceLastRetx string `json:"timeSinceLastRetx"` |
| 70 | + CloseWhenEmpty bool `json:"closeWhenEmpty"` |
| 71 | + AcquiredSafely bool `json:"acquiredSafely"` |
| 72 | +} |
| 73 | + |
| 74 | +type RecvBufferDetail struct { |
| 75 | + Size uint32 `json:"size"` |
| 76 | + PayloadCount uint32 `json:"payloadCount"` |
| 77 | + LastSizeSent uint32 `json:"lastSizeSent"` |
| 78 | + Sequence int32 `json:"sequence"` |
| 79 | + MaxSequence int32 `json:"maxSequence"` |
| 80 | + NextPayload string `json:"nextPayload"` |
| 81 | + AcquiredSafely bool `json:"acquiredSafely"` |
| 82 | +} |
| 83 | + |
| 84 | +type LinkInspectDetail struct { |
| 85 | + Id string `json:"id"` |
| 86 | + Iteration uint32 `json:"iteration"` |
| 87 | + Key string `json:"key"` |
| 88 | + Split bool `json:"split"` |
| 89 | + Protocol string `json:"protocol"` |
| 90 | + DialAddress string `json:"dialAddress"` |
| 91 | + Dest string `json:"dest"` |
| 92 | + DestVersion string `json:"destVersion"` |
| 93 | + Dialed bool `json:"dialed"` |
| 94 | +} |
0 commit comments