-
Notifications
You must be signed in to change notification settings - Fork 21
refactor: Add CIRA log retrieval command #1114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a new ciralog command to retrieve CIRA (Client Initiated Remote Access) connection logs and status information from Intel AMT devices via the PTHI interface.
Changes:
- Added PTHI message types and data structures for CIRA log retrieval
- Implemented GetCiraLog command in AMT and PTHI packages
- Created ciralog command with JSON and text output formatting
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/pthi/types.go | Defines CIRA log request/response constants and extensive data structures for log entries |
| pkg/pthi/commands.go | Implements GetCiraLog method with binary serialization/deserialization logic |
| pkg/amt/commands.go | Adds AMT-level GetCiraLog wrapper with PTHI interface handling |
| internal/commands/ciralog.go | Implements user-facing command with formatting helpers and output functions |
| internal/cli/cli.go | Registers new ciralog command in CLI |
| pkg/amt/commands_test.go | Adds mock implementation for testing |
| internal/rps/message_test.go | Adds mock implementation for testing |
| internal/mocks/amt_mock.go | Adds generated mock method |
| internal/commands/activate/local_test.go | Adds mock implementation for testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/commands/ciralog.go
Outdated
| fmt.Printf("\tIsTunnelOpened(0-Closed, 1-Opened) = %d\n", result.CiraStatusSummary.IsTunnelOpened) | ||
| fmt.Printf("\tCurrentConnectionState = %d (%s)\n", result.CiraStatusSummary.CurrentConnectionState, | ||
| getConnectionStateString(result.CiraStatusSummary.CurrentConnectionState)) | ||
| fmt.Printf("\tLastKeepAlive(The time in which the last keepalive message was sent, 0 if not curently connected) = %d(%s)\n", |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'curently' to 'currently'.
| fmt.Printf("\tLastKeepAlive(The time in which the last keepalive message was sent, 0 if not curently connected) = %d(%s)\n", | |
| fmt.Printf("\tLastKeepAlive(The time in which the last keepalive message was sent, 0 if not currently connected) = %d(%s)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks.
|
|
||
| func formatIPv4(ip uint32) string { | ||
| if ip == 0 { | ||
| return zeroIP |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constant 'zeroIP' is referenced but not defined in this file. Either define it as a constant (e.g., const zeroIP = \"0.0.0.0\") or replace the reference with the literal string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is defined in amtinfo.go which is under the same commands package.
rpc-go/internal/commands/amtinfo.go
Line 34 in f7127fb
| zeroIP = "0.0.0.0" |
pkg/pthi/commands.go
Outdated
| Version: 0, | ||
| } | ||
|
|
||
| var bin_buf bytes.Buffer |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable name 'bin_buf' uses snake_case which is inconsistent with Go naming conventions. Rename to 'binBuf' to follow camelCase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks.
c553666 to
b00d0c8
Compare
b00d0c8 to
3fa4c0b
Compare
Implements the rpc cira-log command to retrieve CIRA (Client Initiated Remote Access) connection logs and status from Intel AMT via PTHI interface. Resolves #1003
453193c to
11b8c8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
11b8c8b to
5377143
Compare
Implements the rpc cira-log command to retrieve CIRA (Client Initiated Remote Access) connection logs and status from Intel AMT via PTHI interface.
Resolves #1003