45 Commits

Author SHA1 Message Date
Bill Mahoney
098ba37907 ci: Protex only scan main 2022-03-10 09:13:41 -07:00
Mike
2a2d6a807b Merge pull request #68 from open-amt-cloud-toolkit/rsdmike-patch-1
docs: add contributing guidelines
2021-10-11 15:12:31 -07:00
Mike
6b7bbbf079 Merge branch 'main' into rsdmike-patch-1 2021-10-09 13:51:32 -07:00
Mike
2b3166dfa0 Merge pull request #67 from open-amt-cloud-toolkit/ci 2021-10-09 13:51:19 -07:00
Mike
926b8d7064 Merge branch 'main' into ci 2021-10-09 11:44:58 -07:00
Mike
62e0b4f037 Merge branch 'main' into rsdmike-patch-1 2021-10-09 11:44:45 -07:00
Mike
24b18f6422 docs(github): add pull request template 2021-10-04 11:39:23 -07:00
Mike
052dff7d6f docs: add contributing guidelines
closes AB#4121
2021-10-04 10:49:05 -07:00
Mike
2c4c42851d ci: rename master to main for jobs 2021-09-29 11:58:53 -07:00
Mike
d4df37c500 Merge pull request #66 from open-amt-cloud-toolkit/v2
docs(changelog): add v2 changelog
2021-09-15 16:10:13 -07:00
Mike
6c7443e7e4 Merge branch 'master' into v2 2021-09-15 15:33:54 -07:00
Mike
d6db3c32cc docs(changelog): add v2 changelog 2021-09-15 15:29:11 -07:00
mpvats-intel
e06d4cbe29 Merge pull request #65 from open-amt-cloud-toolkit/feat_update_openssl
feat: update to OpenSSL 1.1.1l
2021-09-10 11:15:48 -07:00
Mudit Vats
d596186fea feat: update to OpenSSL 1.1.1l 2021-09-09 16:29:21 -07:00
mpvats-intel
61678dc9f6 Merge pull request #64 from open-amt-cloud-toolkit/feat_update_version
feat: update version for release
2021-08-31 10:11:55 -07:00
Mudit Vats
739992cf29 feat: update version for release 2021-08-31 09:50:29 -07:00
mpvats-intel
a9b8d8e5f8 Merge pull request #63 from open-amt-cloud-toolkit/feat_update_vcpkg
feat: Update docs and scripts for Windows and Ubuntu.
2021-08-27 06:41:31 -07:00
Mudit Vats
2a460e90dc feat: update workflows and Docker build. 2021-08-26 13:27:36 -07:00
Mudit Vats
59a8d29ac4 Merge branch 'feat_update_vcpkg' of https://github.com/open-amt-cloud-toolkit/rpc into feat_update_vcpkg 2021-08-26 12:54:52 -07:00
Mudit Vats
cb9539639a feat: Update to latest vcpkg 2021-08-26 12:54:43 -07:00
mpvats-intel
a151146e8a Merge branch 'master' into feat_update_vcpkg 2021-08-25 08:25:25 -07:00
Mudit Vats
bb8211ae03 feat: Update docs and scripts for Windows and Ubuntu. 2021-08-25 08:19:02 -07:00
mpvats-intel
ed5480c7d1 Merge pull request #62 from open-amt-cloud-toolkit/spelling-fix
fix(spelling): lan inteface -> lan interface in amtinfo
2021-08-24 17:00:39 -07:00
Mike
c9a2ab44dd fix(spelling): lan inteface -> lan interface in amtinfo 2021-08-24 16:03:21 -07:00
Mike
fb29227f9d Merge pull request #61 from open-amt-cloud-toolkit/feat_message_formatting
feat: format json status messages
2021-08-18 08:51:44 -07:00
Mudit Vats
26629a1a68 feat: format json status messages 2021-08-17 13:41:07 -07:00
Mike
db924a9b2e build: bump version to v1.3.0 2021-08-02 10:13:39 -07:00
Mike
f0682c4588 Merge pull request #60 from open-amt-cloud-toolkit/fix_klockwork_opens
fix: klockwork reported success / failure check fix
2021-07-21 10:39:29 -07:00
Mudit Vats
913fa41b17 fix: klockwork reported success / failure check fix 2021-07-19 13:25:33 -07:00
Mike
f6666d857b Merge pull request #55 from open-amt-cloud-toolkit/feature_wireless
feat: add AMT wireless adapter info to amtinfo LAN settings.
2021-07-07 10:46:44 -07:00
Mike
e51dc9f1f7 Merge branch 'master' into feature_wireless 2021-07-07 10:20:14 -07:00
Mike
a4929a2d08 Merge pull request #53 from open-amt-cloud-toolkit/update-readme
docs(readme): update readme
2021-07-07 10:20:01 -07:00
Mike
615e9156dc Merge branch 'master' into feature_wireless 2021-07-07 10:19:14 -07:00
Matt Primrose
373a560b1a Merge branch 'master' into update-readme 2021-07-06 17:17:08 -07:00
Matt Primrose
0f8050b6bf Merge pull request #56 from open-amt-cloud-toolkit/changelog_automation
ci(changelog): add automation for changelog generation
2021-07-06 17:16:43 -07:00
Matt Primrose
c70335ae2e Merge branch 'master' into update-readme 2021-07-06 16:21:30 -07:00
Matt Primrose
d94302543b Merge branch 'master' into changelog_automation 2021-07-06 16:20:35 -07:00
Matt Primrose
dea97dec64 Merge pull request #59 from bill-mahoney/master
ci: update scanning
2021-07-06 16:18:24 -07:00
mpvats-intel
cd2887a992 Merge branch 'master' into feature_wireless 2021-07-01 06:16:05 -07:00
Bill Mahoney
33abb9d2d2 ci: update scanning
Signed-off-by: Bill Mahoney <bill.mahoney@intel.com>
2021-06-30 11:18:27 -07:00
bwendlandt-intel
34981ad2c7 docs(readme): wording 2021-06-28 11:42:37 -07:00
Mike
bea1eb22ef Merge branch 'master' into changelog_automation 2021-06-23 11:01:46 -07:00
Mike
ec1374280b ci(changelog): add automation for changelog generation 2021-06-22 16:43:53 -07:00
Mudit Vats
f7dc3f4faa feat: add AMT wireless adapter info to amtinfo LAN settings. 2021-06-22 15:37:11 -07:00
bwendlandt-intel
491f5087de docs(readme): update readme 2021-06-18 15:37:41 -07:00
21 changed files with 433 additions and 180 deletions

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,16 @@
## PR Checklist
<!-- Please check if your PR fulfills the following requirements: -->
- [ ] Unit Tests have been added for new changes
- [ ] API tests have been updated if applicable
- [ ] All commented code has been removed
- [ ] If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.
## What are you changing?
<!-- Please provide a short description of the updates that are in the PR -->
## Anything the reviewer should know when reviewing this PR?
### If the there are associated PRs in other repositories, please link them here (i.e. open-amt-cloud-toolkit/repo#365 )

View File

@@ -24,7 +24,7 @@ jobs:
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
- name: Build VCPKG
run: cd vcpkg && bootstrap-vcpkg.bat
shell: cmd
@@ -71,7 +71,7 @@ jobs:
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
- name: Build VCPKG
run: cd vcpkg && ./bootstrap-vcpkg.sh
shell: bash

20
.github/workflows/changelog.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Changelog Generator
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: docker run -v $PWD:/workdir quay.io/git-chglog/git-chglog --next-tag vNext --output CHANGELOG-new.md vNext..
- name: GitHub Upload Release Artifacts
uses: actions/upload-artifact@v2
with:
name: CHANGELOG-new.md
path: |
./CHANGELOG-new.md

View File

@@ -7,7 +7,7 @@ name: Build RPC (Native)
on:
pull_request:
branches: [ master ]
branches: [ main ]
env:
BUILD_TYPE: Release
@@ -21,7 +21,7 @@ jobs:
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
- name: Build VCPKG
run: cd vcpkg && bootstrap-vcpkg.bat
shell: cmd
@@ -54,7 +54,7 @@ jobs:
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
- name: Build VCPKG
run: cd vcpkg && ./bootstrap-vcpkg.sh
shell: bash

View File

@@ -7,7 +7,7 @@ name: Docker Image CI
on:
push:
branches: [ master ]
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest

View File

@@ -25,8 +25,9 @@ sudo apt install git cmake build-essential curl zip unzip tar pkg-config
Open a Terminal window.
```
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
./bootstrap-vcpkg.sh
./vcpkg install cpprestsdk[websockets]
```
@@ -68,8 +69,9 @@ Steps below are for Windows 10 and Visual Studio 2019 Professional.
Open an x64 Native Tools Command Prompt for Visual Studio 2019.
```
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
bootstrap-vcpkg.bat
vcpkg install cpprestsdk[websockets]:x64-windows-static
```

View File

@@ -1,3 +1,45 @@
<a name="v2.0.0"></a>
## v2.0.0
### Build
- bump version to v1.3.0
- bump version to v2.0.0
### Ci
- update scanning
### Docs
- **readme:** wording
- **readme:** update readme
- **security:** added SECURITY.md file
### Feat
- update to OpenSSL 1.1.1l
- update workflows and Docker build.
- Update to latest vcpkg
- Update docs and scripts for Windows and Ubuntu.
- format json status messages
- add AMT wireless adapter info to amtinfo LAN settings.
### Fix
- klockwork reported success / failure check fix
- **spelling:** lan inteface -> lan interface in amtinfo
<a name="v1.2.2"></a>
## [v1.2.2] - 2021-06-22
### Ci
- remove Jenkins chron
- **changelog:** add automation for changelog generation
### Fix
- update examples text and version
<a name="v1.2.1"></a>
## [v1.2.1] - 2021-05-06
### Fix
**docker:** add missing ca-certs
<a name="v1.2.0"></a>
## v1.2.0

View File

@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.1)
project (rpc VERSION 1.2.1)
project (rpc VERSION 2.0.0)
set (CMAKE_CXX_STANDARD 11)

101
CONTRIBUTING.MD Normal file
View File

@@ -0,0 +1,101 @@
## <a name="commit"></a> Commit Message Guidelines
We have precise rules over how our git commit messages should be formatted. This leads to more readable messages that are easy to follow when looking through the project history.
### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The **header** with **type** is mandatory. The **scope** of the header is optional as far as the automated PR checks are concerned, but be advised that PR reviewers **may request** you provide an applicable scope.
Any line of the commit message should no be longer 72 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
The footer should contain a reference to an Azure Boards ticket (e.g. AB#[number]).
Example 1:
```
feat(telemetry): Add new MQTT events
Events are now emitted over various /mps topics on MQTT for success/failures
as they occur throughout the service.
Resolves: AB#2222
```
### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
### Type
Must be one of the following:
* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests or correcting existing tests
* **build**: Changes that affect the CI/CD pipeline or build system or external dependencies (example scopes: travis, jenkins, makefile)
* **ci**: Changes provided by DevOps for CI purposes.
* **revert**: Reverts a previous commit.
### Scope
Should be one of the following:
Modules:
* **common**: A change or addition to the common module
* **tracker**: A change or addition to the tracker module
* **server**: A change or addition to the server module
* **msgs**: A change or addition to msgs module
* **eval**: Any change to benchmark tools
* **deps**: A change to any dependency or 3rd-party library
* **all**: A change that affects all modules
* *no scope*: If no scope is provided, it is assumed the PR does not apply to the above scopes
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
Here is detailed guideline on how to write the body of the commit message ([Reference](https://chris.beams.io/posts/git-commit/)):
```
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.
Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
```
### Footer
The footer should contain a reference to JIRA ticket (e.g. SL6-0000) that this commit **Closes** or **Resolves**.
The footer should contain any information about **Breaking Changes**.
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
### Pull Requests practices
* PR author is responsible to merge its own PR after review has been done and CI has passed.
* When merging, make sure git linear history is preserved. PR author should select a merge option (`Rebase and merge` or `Squash and merge`) based on which option will fit the best to the git linear history.
* PR topic should follow the same guidelines as the header of the [Git Commit Message](#commit-message-format)

View File

@@ -50,8 +50,9 @@ export PATH=/home/user/Downloads/git:$PATH
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
```
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
./bootstrap-vcpkg.sh
./vcpkg install cpprestsdk[websockets]
```

View File

@@ -28,8 +28,9 @@ sudo yum install cmake
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
```
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
./bootstrap-vcpkg.sh
./vcpkg install cpprestsdk[websockets]
```

View File

@@ -15,7 +15,7 @@ RUN \
RUN git clone https://github.com/open-amt-cloud-toolkit/rpc.git
WORKDIR /rpc
RUN mkdir -p build
RUN git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
RUN git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
RUN cd vcpkg && ./bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install cpprestsdk[websockets]

164
Jenkinsfile vendored
View File

@@ -1,16 +1,14 @@
pipeline {
agent none
agent {
label 'docker-amt'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5', daysToKeepStr: '30'))
timestamps()
timeout(unit: 'HOURS', time: 2)
}
stages {
stage ('Parallel') {
parallel {
stage ('Linux') {
agent { label 'docker-amt' }
stages {
stage ('Cloning Repository') {
steps {
@@ -21,41 +19,20 @@ pipeline {
}
}
}
stage('Static Code Scan - Protex') {
environment{
PROJECT_NAME = 'OpenAMT - RPC'
SCANNERS = 'protex'
}
when {
anyOf {
branch 'main';
}
}
stage ('Windows') {
agent { label 'openamt-win' }
stages {
stage ('Cloning Repository') {
steps {
script {
scmCheckout {
clean = true
rbheStaticCodeScan()
}
}
}
}
}
}
}
}
stage ('Static Code Scan - Protex') {
agent { label 'docker-amt' }
steps {
script {
staticCodeScan {
// generic
scanners = ['protex']
scannerType = ['c','c++']
protexProjectName = 'OpenAMT - RPC'
// internal, do not change
protexBuildName = 'rrs-generic-protex-build'
}
}
}
}
stage ('Parallel Builds') {
parallel {
stage ('Linux') {
@@ -71,6 +48,7 @@ pipeline {
steps {
sh './scripts/jenkins-pre-build.sh'
sh './scripts/jenkins-build.sh'
stash includes: 'build/rpc', name: 'linux-rpc-app'
}
}
stage ('Archive') {
@@ -78,7 +56,6 @@ pipeline {
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/rpc', caseSensitive: false, onlyIfSuccessful: true
}
}
}
}
stage ('Windows') {
@@ -89,7 +66,7 @@ pipeline {
bat 'scripts\\jenkins-pre-build.cmd'
bat 'scripts\\jenkins-build.cmd'
// prepare stash for the binary scan
stash includes: "**/*.exe", name: 'rpc-app'
stash includes: '**/*.exe', name: 'win-rpc-app'
}
}
stage ('Archive') {
@@ -101,70 +78,81 @@ pipeline {
}
}
}
stage ('Parallel Scans') {
parallel {
stage ('Static Code Scan Linux') {
agent { label 'docker-amt' }
stage('Prep Binary') {
steps {
script {
staticCodeScan {
// generic
scanners = ['bdba','klocwork']
scannerType = 'c++'
sh 'mkdir -p ./bin'
dir('./bin') {
unstash 'linux-rpc-app'
unstash 'win-rpc-app'
}
}
}
stage('Linux Scans') {
environment{
PROJECT_NAME = 'OpenAMT - RPC - Linux'
SCANNERS = 'bdba,klocwork'
protecodeGroup = '25'
protecodeScanName = 'rpc-zip'
protecodeDirectory = './build/rpc'
// protecode details
PROTECODE_BIN_DIR = './bin'
PROTECODE_INCLUDE_SUB_DIRS = true
// klocwork details
KLOCWORK_SCAN_TYPE = 'c++'
KLOCWORK_PRE_BUILD_SCRIPT = './scripts/jenkins-pre-build.sh'
KLOCWORK_BUILD_COMMAND = './scripts/jenkins-build.sh'
KLOCWORK_IGNORE_COMPILE_ERRORS = true
// publishArtifacts details
PUBLISH_TO_ARTIFACTORY = true
}
steps {
rbheStaticCodeScan()
dir('artifacts/Klockwork'){
sh 'cp kw_report.html kw_report_linux.html'
sh 'cp kw_report.csv kw_report_linux.csv'
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_linux.html'
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_linux.csv'
}
klockworkPreBuildScript = './scripts/jenkins-pre-build.sh'
klockworkBuildCommand = './scripts/jenkins-build.sh'
klockworkProjectName = 'Panther Point Creek'
klockworkIgnoreCompileErrors = true
}
}
}
}
stage ('Static Code Scan Windows') {
stages {
stage ('Static Code Scan Windows - Klockwork') {
stage('Windows Scans'){
agent { label 'openamt-win' }
steps {
script {
staticCodeScan {
// generic
scanners = ['klocwork']
scannerType = 'c++'
stages{
stage ('Windows Scans - klocwork') {
environment {
PROJECT_NAME = 'OpenAMT - RPC - Windows'
SCANNERS = 'klocwork'
klockworkPreBuildScript = 'scripts\\jenkins-pre-build.cmd'
klockworkBuildCommand = 'scripts\\jenkins-build.cmd'
klockworkProjectName = 'Panther Point Creek'
klockworkIgnoreCompileErrors = true
}
}
}
}
stage ('Static Code Scan Windows - BDBA') {
agent { label 'docker-amt' }
steps {
script {
sh "mkdir -p bdbaScanDir"
dir("bdbaScanDir") {
unstash 'rpc-app'
}
staticCodeScan {
// generic
scanners = ['bdba']
scannerType = 'c++'
// klocwork details
KLOCWORK_SCAN_TYPE = 'c++'
KLOCWORK_PRE_BUILD_SCRIPT = 'scripts\\jenkins-pre-build.cmd'
KLOCWORK_BUILD_COMMAND = 'scripts\\jenkins-build.cmd'
KLOCWORK_IGNORE_COMPILE_ERRORS = true
protecodeGroup = '25'
protecodeScanName = 'rpc-zip'
protecodeDirectory = 'bdbaScanDir'
// publishArtifacts details
PUBLISH_TO_ARTIFACTORY = true
}
steps {
rbheStaticCodeScan()
dir('artifacts\\Klockwork'){
bat 'copy kw_report.html kw_report_windows.html'
bat 'copy kw_report.csv kw_report_windows.csv'
stash includes: 'kw_report_windows.*', name: 'win-kwreports'
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_windows.html'
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_windows.csv'
}
}
}
}
}
stage('Publish Artifacts'){
steps{
dir('artifacts/Klockwork'){
unstash 'win-kwreports'
}
publishArtifacts()
}
}
}

View File

@@ -4,26 +4,43 @@
The Remote Provisioning Client (RPC) is an application that enables remote capabilities for Intel® AMT, such as as device activation and configuration. To accomplish this, RPC communicates with the Remote Provisioning Server (RPS) to activate and connect the edge device.
<br><br>
**For detailed documentation** about RPC or other features of the Open AMT Cloud Toolkit, see the [docs](https://open-amt-cloud-toolkit.github.io/docs/).
<br>
## Prerequisites
We leverage GitHub Actions as a means to build RPC automatically leveraging Github's CI/CD Infrastructure. This avoids having to deal with the challenges of getting your build environment just right on your local machine and allows you to get up and running much faster. Read more about GitHub Actions [here](https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/#:~:text=GitHub%20Actions%20is%20an%20API,every%20step%20along%20the%20way.)
## Build the Remote Provisioning Client (RPC)
<p align="center">
<img src="assets/animations/forkandbuild.gif" width="650" />
</p>
1. Create a fork of the rpc repository [here](https://github.com/open-amt-cloud-toolkit/rpc/fork) or via the Fork button in the top-right corner of the rpc repository.
## Build the Remote Provisioning Client (RPC)
2. Click on "Actions" and Select "Build RPC (Native)" Workflow.
1. <a href="https://github.com/open-amt-cloud-toolkit/rpc/fork" target="_blank">Create a fork of rpc on GitHub.</a>
3. Click "Run Workflow", select branch "master", and click "Run Workflow".
2. Click on the **Actions** tab at the top and select **Build RPC (Native) Debug/Release**.
4. Grab a coffee. The build for Windows will take approximately 30 minutes and the build for Linux will take approximately 5 minutes.
3. Click the **Run Workflow** dropdown.
5. Once complete, click the completed job, and download the appropriate RPC for your OS under the "Artifacts" section.
4. Select the **Branch: main**, or a preferred version, from the **Use workflow from** dropdown.
5. By default, the Build Type should be **release**.
6. Click the **Run Workflow** button. Grab a coffee and take a break! The build time ranges from 15 to 20 minutes.
8. Once the download is complete, click the completed job which will feature a green checkmark.
9. Download the appropriate RPC for your managed device's OS under the **Artifacts** section.
### To Delete your workflow run
1. Click the ellipsis ( **...** ) menu for the workflow.
2. Choose the **Delete workflow run** option.
For detailed documentation about RPC and using it to activate a device, see the [docs](https://open-amt-cloud-toolkit.github.io/docs/)

View File

@@ -282,8 +282,10 @@ bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries)
for (int i = 0; i < (int) amt_hash_handles.Length; i++)
{
// get each entry
AMT_STATUS status = pthi_GetCertificateHashEntry(amt_hash_handles.Handles[i], &certhash_entry);
AMT_STATUS amt_status = pthi_GetCertificateHashEntry(amt_hash_handles.Handles[i], &certhash_entry);
if (amt_status == 0)
{
int hashSize;
cert_hash_entry tmp;
switch (certhash_entry.HashAlgorithm) {
@@ -329,6 +331,7 @@ bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries)
hash_entries.push_back(tmp);
}
}
}
return true;
}
@@ -377,14 +380,14 @@ bool cmd_get_remote_access_connection_status(int& network_status, int& remote_st
return false;
}
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings)
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings, bool wired_interface)
{
// initialize HECI interface
if (heci_Init(NULL, PTHI_CLIENT) == 0) return false;
// get wired interface
LAN_SETTINGS lan_settings;
UINT32 interface_settings = 0; // wired=0, wireless=1
UINT32 interface_settings = (wired_interface) ? 0 : 1; // wired=0, wireless=1
AMT_STATUS amt_status = pthi_GetLanInterfaceSettings(interface_settings, &lan_settings);
if (amt_status == 0)
{
@@ -393,11 +396,13 @@ bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settin
lan_interface_settings.dhcp_enabled = lan_settings.DhcpEnabled;
lan_interface_settings.link_status = lan_settings.LinkStatus;
lan_interface_settings.ip_address.clear();
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 24) & 0xff);
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 16) & 0xff);
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 8) & 0xff);
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address) & 0xff);
lan_interface_settings.mac_address.clear();
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[0]);
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[1]);
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[2]);

View File

@@ -49,6 +49,6 @@ bool cmd_get_dns_suffix(std::string& suffix);
bool cmd_get_wired_mac_address(std::vector<unsigned char>& address);
bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries);
bool cmd_get_remote_access_connection_status(int& network_status, int& remote_status, int& remote_trigger, std::string& mps_hostname);
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings);
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings, bool wired_interface = true);
#endif

View File

@@ -20,7 +20,7 @@ void out_text(const std::string name, const std::vector<unsigned char> value, co
for (unsigned char tmp : value)
{
(hex) ? std::cout << std::setfill('0') << std::setw(2) << std::hex << (unsigned int)tmp
: std::cout << (unsigned int)tmp;
: std::cout << std::dec << (unsigned int)tmp;
if (char_count++ < value.size())
{
@@ -270,15 +270,41 @@ bool info_get_lan_interface_settings()
tmp.ip_address.clear();
tmp.mac_address.clear();
if (!cmd_get_lan_interface_settings(tmp)) return false;
bool hasWired = cmd_get_lan_interface_settings(tmp);
if (hasWired)
{
out_text("LAN Interface", "wired");
out_text("DHCP Enabled", (tmp.dhcp_enabled) ? "true" : "false");
out_text("DHCP Mode", (tmp.dhcp_mode == 1) ? "active" : "passive");
out_text("Link Status", (tmp.link_status) ? "up" : "down");
out_text("IP Address", tmp.ip_address, '.', false);
out_text("MAC Address", tmp.mac_address, ':');
}
tmp.is_enabled = false;
tmp.link_status = false;
tmp.dhcp_enabled = false;
tmp.dhcp_mode = 0;
tmp.ip_address.clear();
tmp.mac_address.clear();
bool hasWireless = cmd_get_lan_interface_settings(tmp, false);
if (hasWireless)
{
out_text("LAN Interface", "wireless");
out_text("DHCP Enabled", (tmp.dhcp_enabled) ? "true" : "false");
out_text("DHCP Mode", (tmp.dhcp_mode == 1) ? "active" : "passive");
out_text("Link Status", (tmp.link_status) ? "up" : "down");
out_text("IP Address", tmp.ip_address, '.', false);
out_text("MAC Address", tmp.mac_address, ':');
}
if (hasWired || hasWireless)
{
return true;
}
return false;
}
bool info_get(const std::string info)

View File

@@ -7,6 +7,7 @@
#include <thread>
#include <cpprest/ws_client.h>
#include <cpprest/json.h>
#include <algorithm>
#include "port.h"
#include "lms.h"
#include "commands.h"
@@ -271,7 +272,22 @@ int main(int argc, char* argv[])
g_timeout_val = 0;
// exit
try {
std::cout << std::endl;
utility::string_t tmp = utility::conversions::convertstring(msgMessage);
web::json::value parsed = web::json::value::parse(tmp);
for (const auto& obj : parsed.as_object()) {
std::string key = utility::conversions::to_utf8string(obj.first);
std::string value = utility::conversions::to_utf8string(obj.second.serialize());
value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
std::cout << key << ": " << value << std::endl;
}
}
catch (...)
{
std::cout << std::endl << msgMessage << std::endl;
}
return;
}
else if (msgStatus.compare("failed")==0)
@@ -280,7 +296,22 @@ int main(int argc, char* argv[])
g_timeout_val = 0;
// exit
try {
std::cout << std::endl;
utility::string_t tmp = utility::conversions::convertstring(msgMessage);
web::json::value parsed = web::json::value::parse(tmp);
for (const auto& obj : parsed.as_object()) {
std::string key = utility::conversions::to_utf8string(obj.first);
std::string value = utility::conversions::to_utf8string(obj.second.serialize());
value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
std::cout << key << ": " << value << std::endl;
}
}
catch (...)
{
std::cout << std::endl << msgMessage << std::endl;
}
return;
}

View File

@@ -15,8 +15,9 @@ set VCPKG_DIR=C:\opt\vcpkg-source
cd %VCPKG_DIR%
REM build vcpkg
git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
cmd /c bootstrap-vcpkg.bat
REM install CPPRestSDK

View File

@@ -12,8 +12,9 @@ apt install git cmake build-essential curl zip unzip tar pkg-config -y
#cd "$BASE_DIR"/rpc
## build vcpkg
git -C vcpkg pull || git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git vcpkg
git -C vcpkg pull || git clone https://github.com/microsoft/vcpkg.git vcpkg
cd vcpkg
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
./bootstrap-vcpkg.sh
## install CPPRestSDK

1
vcpkg Submodule

Submodule vcpkg added at 5568f110b5