Skip to content

Conversation

@sinchubhat
Copy link
Contributor

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

@sinchubhat sinchubhat requested a review from Copilot January 22, 2026 05:25
Copy link

Copilot AI left a 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.

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",
Copy link

Copilot AI Jan 22, 2026

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'.

Suggested change
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",

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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
Copy link

Copilot AI Jan 22, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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.

zeroIP = "0.0.0.0"

Version: 0,
}

var bin_buf bytes.Buffer
Copy link

Copilot AI Jan 22, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks.

@sinchubhat sinchubhat changed the base branch from main to next January 28, 2026 13:11
@sinchubhat sinchubhat force-pushed the issue1003-rpc-go branch 3 times, most recently from c553666 to b00d0c8 Compare February 3, 2026 04:14
@sinchubhat sinchubhat changed the title feat: Add CIRA log retrieval command refactor: Add CIRA log retrieval command Feb 3, 2026
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
@sinchubhat sinchubhat force-pushed the issue1003-rpc-go branch 2 times, most recently from 453193c to 11b8c8b Compare February 6, 2026 09:18
@sinchubhat sinchubhat requested a review from Copilot February 6, 2026 09:28
Copy link

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request - Add the ability to retrieve the Cira log

1 participant