Compare commits

...

79 Commits

Author SHA1 Message Date
snyk-bot e5a3f802f3 fix: Dockerfile to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-UBUNTU2004-BASH-581100
- https://snyk.io/vuln/SNYK-UBUNTU2004-SYSTEMD-1290722
- https://snyk.io/vuln/SNYK-UBUNTU2004-SYSTEMD-1290722
- https://snyk.io/vuln/SNYK-UBUNTU2004-SYSTEMD-582552
- https://snyk.io/vuln/SNYK-UBUNTU2004-SYSTEMD-582552
2021-05-20 19:38:28 +00:00
Mike 39ddea389a Merge pull request #48 from open-amt-cloud-toolkit/docker
build(docker): revert to ubuntu 20.04
2021-05-06 12:07:01 -07:00
Mike 9aa745e5a2 build(docker): revert to ubuntu 20.04 2021-05-06 11:45:56 -07:00
Mike 38c8bc2384 Merge pull request #47 from open-amt-cloud-toolkit/add_missing_ca
fix(docker): add missing ca-certs
2021-05-05 22:34:30 -07:00
Mike 584ca67799 build(docker): bump to ubuntu-20.10 2021-05-05 16:31:58 -07:00
Mike cf7fac325f fix(docker): add missing ca-certs 2021-05-05 16:04:58 -07:00
Mike 8569684593 Merge pull request #40 from bill-mahoney/jenkins-feedback
ci: update build for scanning
2021-04-08 11:46:51 -07:00
Mike 1e72b281a5 Merge branch 'master' into jenkins-feedback 2021-04-06 09:56:45 -07:00
Mike 75673aa373 Merge pull request #43 from open-amt-cloud-toolkit/v1.2.0
docs: add changelog.md
2021-04-05 10:31:36 -07:00
Mike 5772e831ad docs: add changelog.md 2021-04-02 21:16:43 -07:00
Bill Mahoney 67202dc5d3 ci: update build for scanning
Signed-off-by: Bill Mahoney <bill.mahoney@intel.com>
2021-03-31 18:11:41 -07:00
mpvats-intel 6d490aec65 Merge pull request #39 from open-amt-cloud-toolkit/feature_update_version
feat: update RPC version to 1.2.0.
2021-03-29 14:58:30 -07:00
Mudit Vats 41f8f8553c feat: update RPC version to 1.2.0. 2021-03-29 14:35:21 -07:00
mpvats-intel bc1f8d0cfb Merge pull request #38 from open-amt-cloud-toolkit/feature_heatbeat
feat: add heartbeat capability
2021-03-23 16:25:05 -07:00
Mudit Vats a8e1bc89f0 feat: add heartbeat capability 2021-03-23 14:00:49 -07:00
Mike 5b5a480943 Merge pull request #36 from open-amt-cloud-toolkit/test
ci: breakout docker build for merge only
2021-03-16 16:00:42 -07:00
Mike a190a214f1 ci: breakout docker build for merge only 2021-03-16 15:29:52 -07:00
Mike 54b7550e31 Merge pull request #35 from rsdmike/dockersupport
feat(docker): add dockerfile support for RPC
2021-03-16 14:48:11 -07:00
Mike e4deeca506 feat(docker): add dockerfile support for RPC 2021-03-16 14:44:28 -07:00
trleasher-intel 365ad90adc Merge pull request #31 from open-amt-cloud-toolkit/fix_msg_cleanup
fix: use message status instead, cleanup message fields.
2021-02-23 09:27:01 -07:00
Mudit Vats 2984880b6e fix: use message status instead, cleanup message fields. 2021-02-23 08:25:46 -07:00
trleasher-intel da9c26bc26 Merge pull request #30 from open-amt-cloud-toolkit/feature_test_framework
feat: add unit test framework
2021-02-16 08:37:47 -07:00
Mudit Vats bb4e144684 feat: add unit test framework 2021-02-12 16:49:02 -07:00
trleasher-intel 86cf9657ad Merge pull request #29 from open-amt-cloud-toolkit/feature_hostname
feat: add hostname to activation info
2021-02-12 15:54:23 -07:00
Mudit Vats 025152f359 feat: add hostname to activation info 2021-02-12 14:42:43 -07:00
mpvats-intel 9b0d7fe649 Merge pull request #26 from open-amt-cloud-toolkit/changelog
docs: changelog
2021-02-11 13:05:49 -07:00
Mike b2a54c47a3 Merge branch 'master' into changelog 2021-02-11 12:11:55 -07:00
Mike a859cf5648 docs: add changelog 2021-02-11 12:11:34 -07:00
mpvats-intel 5a9597fc2b Merge pull request #27 from open-amt-cloud-toolkit/fix_kw_defect
fix: free fqdn buffer
2021-02-11 11:16:47 -07:00
Mudit Vats b1f7b32baa fix: free fqdn buffer 2021-02-11 10:28:16 -07:00
mpvats-intel 2fb64ac3f8 Merge pull request #24 from open-amt-cloud-toolkit/feature_version_tick
feat: version update
2021-02-09 14:59:29 -07:00
Mudit Vats b03e2988a5 feat: version update 2021-02-09 13:49:09 -07:00
mpvats-intel acf428537f Merge pull request #23 from open-amt-cloud-toolkit/jenkins_scripts
build(jenkins): jenkins build scripts for Windows and Ubuntu
2021-02-09 08:53:45 -07:00
trleasher-intel 6cd660a7af build(jenkins): jenkins build scripts for Windows and Ubuntu 2021-02-09 08:02:21 -07:00
mpvats-intel c4de327e7e Merge pull request #21 from rsdmike/master
ci: add support for debug/release builds
2021-02-02 10:17:41 -07:00
Mike fc600d61a1 Merge branch 'master' of https://github.com/rsdmike/rpc 2021-02-02 09:49:41 -07:00
Mike 41a1be5249 ci: update build 2021-02-02 09:49:24 -07:00
Mike 4e5dccce89 ci: update build 2021-01-29 13:42:56 -07:00
Mike 0679235cba Merge branch 'master' of https://github.com/rsdmike/rpc 2021-01-29 10:12:21 -07:00
Mike 95a422478b Merge pull request #22 from open-amt-cloud-toolkit/semantic
ci: add types for conventional commits
2021-01-28 20:55:08 -07:00
Mike f9f70d23f9 Merge branch 'master' into semantic 2021-01-28 16:29:34 -07:00
mpvats-intel f1b32ef953 Merge pull request #20 from open-amt-cloud-toolkit/feature_nocertcheck
feat: cli skip cert checking
2021-01-28 15:45:09 -07:00
Mudit Vats d23b1c4be5 Add newline. 2021-01-28 15:22:57 -07:00
Mudit Vats b54025168c Add --nocertcheck, -n args to skip websocket server certificate verification for all builds. 2021-01-28 14:57:56 -07:00
Mike 6433a553a0 Merge pull request #11 from rsdmike/releaseOption
ci: add support for release or debug
2021-01-28 14:43:19 -07:00
Mike b13c070598 Merge pull request #10 from rsdmike/releaseOption
ci: add support for release or debug
2021-01-28 13:44:09 -07:00
Mike ecc31a25f7 ci: add support for release or debug
Signed-off-by: Mike <michael.johanson@intel.com>
2021-01-28 13:41:34 -07:00
Mike 01316bcfa2 Merge pull request #19 from open-amt-cloud-toolkit/github_actions
ci: add ci for status checks
2021-01-27 13:02:20 -07:00
Mike c1fbf6aa39 ci: add types for conventional commits
Signed-off-by: Mike <michael.johanson@intel.com>
2021-01-24 16:36:12 -07:00
Mike fd5817461e ci: add ci for status checks
Signed-off-by: Mike <michael.johanson@intel.com>
2021-01-19 17:00:40 -07:00
mpvats-intel a889f91cdc Merge pull request #18 from open-amt-cloud-toolkit/feature_linux_vcpkg
Feature Linux vcpkg, CentOS support.
2021-01-15 10:54:57 -07:00
trleasher-intel a32e109913 Updates for using Vcpkg for both Linux and Windows 2021-01-15 09:23:37 -07:00
Mike 9efc9476a4 Merge pull request #17 from rsdmike/disclaimer
docs: add release disclaimer
2021-01-14 09:20:36 -07:00
Mike aa7d888fab docs: add release disclaimer
Signed-off-by: Mike <michael.johanson@intel.com>
2021-01-14 09:09:32 -07:00
Mudit Vats aa68d7cfdb Use latest vcpkg release 2021-01-12 14:05:27 -07:00
Mudit Vats 434c9a1cc2 Use latest vcpkg release 2021-01-12 14:03:32 -07:00
Mudit Vats 8b4f3b00bb Update dependencies 2021-01-07 15:49:48 -07:00
Mudit Vats 53bc0c42da Fix vcpkg boostrap command. Add CentOS8 build notes. 2021-01-06 13:58:23 -07:00
Mudit Vats dbb825c49e Build Git instead 2021-01-05 13:44:43 -07:00
Mudit Vats 385ea2b9c3 Build Git instead 2021-01-05 13:43:48 -07:00
Mudit Vats 0ecd6c9911 Use -DNO_SELECT=ON to work around select behavior on older distros 2021-01-04 14:38:40 -07:00
Mudit Vats ca85fa4d14 Build Linux with VCPKG instead; previously explicitly cloning CPPRESTSDK and manually building. Now, VCPKG and CPPRESTSDK must be built before building RPC. See Build.md for build notes. 2020-12-18 09:11:34 -07:00
mpvats-intel 711d9ef58d Merge pull request #16 from open-amt-cloud-toolkit/fqdn
Add/update DNS Suffix (OS), Hostname (OS), fqdn [AMT] and DNS Suffix …
2020-12-18 06:49:00 -07:00
Mudit Vats 458d6ba2e2 Remove unused code 2020-12-17 15:05:39 -07:00
Mudit Vats d2633af0c5 Add/update DNS Suffix (OS), Hostname (OS), fqdn [AMT] and DNS Suffix [AMT] info returned by --amtinfo. 2020-12-17 11:08:13 -07:00
mpvats-intel 3bfb88aeb6 Merge pull request #14 from open-amt-cloud-toolkit/link_status_fix
Fix link status not being set.
2020-12-17 10:56:43 -07:00
bwendlandt-intel d22f00ec0b Merge pull request #15 from bwendlandt-intel/docs_link_update
update to new docs location
2020-12-07 11:34:04 -07:00
bwendlandt-intel cd4046c741 update to new docs location 2020-12-07 10:46:22 -07:00
Mudit Vats 584a8e4f34 Set link status 2020-12-07 10:41:21 -07:00
Mike 1fc6816153 Merge pull request #13 from open-amt-cloud-toolkit/rsdmike-patch-1
Create LICENSE
2020-11-20 15:30:33 -07:00
Mike a5788382d7 Create LICENSE 2020-11-20 15:29:37 -07:00
Mike f5aa168acb Merge pull request #12 from open-amt-cloud-toolkit/ActivEdge
1.0 release
2020-11-20 15:13:41 -07:00
bwendlandt-intel a2c396bae1 Add readme edits for release of doc site (#11)
* Update README for 1.0

* Fix gif link

* gif sizing and punctuation matching

Co-authored-by: bwendlandt-intel <bryan-wendlandt@intel.com>
2020-11-20 14:31:36 -07:00
Mike bbf9ea967b Merge pull request #10 from rsdmike/github_automation
build: Add Github Actions Support
2020-11-19 09:02:39 -07:00
Mike 722a97958f build: Add Github Actions Support
Signed-off-by: Mike <michael.johanson@intel.com>
2020-11-13 14:49:10 -07:00
Mudit Vats 6d2e37e7fc Update amtinfo, usage and admin check. General code cleanup and bug fixes. 2020-10-30 09:51:18 -07:00
Mudit Vats eb42f1e89d Update license. 2020-09-08 13:40:45 -07:00
Mudit Vats 23fe0e1663 Developer Experience Release. Added LMS and code refactor. 2020-09-01 16:04:04 -07:00
Mudit Vats 958096a375 Add CMake requirements. 2020-07-17 14:17:23 -07:00
76 changed files with 22331 additions and 1055 deletions
+42
View File
@@ -0,0 +1,42 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]
{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
+28
View File
@@ -0,0 +1,28 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/open-amt-cloud-toolkit/rpc
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
# title_maps:
# feat: Features
# fix: Bug Fixes
# perf: Performance Improvements
# refactor: Code Refactoring
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
+14
View File
@@ -0,0 +1,14 @@
allowMergeCommits: true
# Always validate the PR title AND all the commits
titleAndCommits: true
types:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- revert
+101
View File
@@ -0,0 +1,101 @@
#*********************************************************************
# Copyright (c) Intel Corporation 2020
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
name: Build RPC (Native) Debug/Release
on:
workflow_dispatch:
inputs:
build_type:
description: 'Build Type can be "debug" or "release".'
required: true
default: "release"
env:
BUILD_TYPE: ${{github.event.inputs.build_type}}
jobs:
build-windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
- name: Build VCPKG
run: cd vcpkg && bootstrap-vcpkg.bat
shell: cmd
- name: dir
run: ls
- name: dir
run: cd vcpkg && ls
- name: Install C++ REST SDK
run: ${{ runner.workspace }}\rpc\vcpkg\vcpkg.exe install cpprestsdk[websockets]:x64-windows-static
shell: cmd
- name: dir
run: ls && cd vcpkg && ls
shell: bash
- name: Prepare for build
run: cd build && cmake .. -DCMAKE_PREFIX_PATH=D:/a/rpc/rpc/vcpkg/installed/x64-windows-static -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=D:/a/rpc/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build RPC (Debug)
if: ${{ github.event.inputs.build_type }} == "debug"
run: cd build && cmake --build . --config Debug
- name: Build RPC (Release)
if: ${{ github.event.inputs.build_type }} == "release"
run: cd build && cmake --build . --config Release
- name: GitHub Upload Release Artifacts
if: ${{ github.event.inputs.build_type }} == "release"
uses: actions/upload-artifact@v2
with:
name: RPC_Windows_release.exe
path: ${{ runner.workspace }}\rpc\build\Release\rpc.exe
- name: GitHub Upload Release Artifacts
if: ${{ github.event.inputs.build_type }} == "debug"
uses: actions/upload-artifact@v2
with:
name: RPC_Windows_debug.exe
path: ${{ runner.workspace }}\rpc\build\Debug\rpc.exe
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt install git cmake build-essential curl zip unzip tar pkg-config
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
- name: Build VCPKG
run: cd vcpkg && ./bootstrap-vcpkg.sh
shell: bash
- name: dir
run: ls
- name: dir
run: cd vcpkg && ls
- name: Install C++ REST SDK
run: ${{ runner.workspace }}/rpc/vcpkg/vcpkg install cpprestsdk[websockets]
shell: bash
- name: dir
run: ls && cd vcpkg && ls
shell: bash
- name: Prepare for build
if: ${{ github.event.inputs.build_type }} == "debug"
run: cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Prepare for build
if: ${{ github.event.inputs.build_type }} == "release"
run: cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build RPC
run: cd build && cmake --build .
- name: GitHub Upload Release Artifacts
uses: actions/upload-artifact@v2
with:
name: RPC_Linux_${{ matrix.os }}_${{github.event.inputs.build_type}}
path: |
build/rpc
+74
View File
@@ -0,0 +1,74 @@
#*********************************************************************
# Copyright (c) Intel Corporation 2020
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
name: Build RPC (Native)
on:
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs:
build-windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
- name: Build VCPKG
run: cd vcpkg && bootstrap-vcpkg.bat
shell: cmd
- name: dir
run: ls
- name: dir
run: cd vcpkg && ls
- name: Install C++ REST SDK
run: ${{ runner.workspace }}\rpc\vcpkg\vcpkg.exe install cpprestsdk[websockets]:x64-windows-static
shell: cmd
- name: dir
run: ls && cd vcpkg && ls
shell: bash
- name: Prepare for build
run: cd build && cmake .. -DCMAKE_PREFIX_PATH=D:/a/rpc/rpc/vcpkg/installed/x64-windows-static -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=D:/a/rpc/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build RPC (Release)
run: cd build && cmake --build . --config Release
- name: Build RPC (Debug)
run: cd build && cmake --build . --config Debug
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt install git cmake build-essential curl zip unzip tar pkg-config
- name: Create Build Dir
run: mkdir build
- name: Clone
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
- name: Build VCPKG
run: cd vcpkg && ./bootstrap-vcpkg.sh
shell: bash
- name: dir
run: ls
- name: dir
run: cd vcpkg && ls
- name: Install C++ REST SDK
run: ${{ runner.workspace }}/rpc/vcpkg/vcpkg install cpprestsdk[websockets]
shell: bash
- name: dir
run: ls && cd vcpkg && ls
shell: bash
- name: Prepare for build
run: cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build RPC
run: cd build && cmake --build .
+29
View File
@@ -0,0 +1,29 @@
#*********************************************************************
# Copyright (c) Intel Corporation 2020
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
name: Docker Image CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build -f "Dockerfile" --tag vprodemo.azurecr.io/rpc:${{ github.sha }} --tag vprodemo.azurecr.io/rpc:latest .
- name: Docker Login
uses: docker/login-action@v1.6.0
with:
registry: vprodemo.azurecr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: true
- name: Push the Docker image to the registry
run: docker push vprodemo.azurecr.io/rpc:${{ github.sha }}
- name: Push the Docker image to the registry
run: docker push vprodemo.azurecr.io/rpc:latest
+2
View File
@@ -9,3 +9,5 @@ compile_commands.json
CTestTestfile.cmake CTestTestfile.cmake
build/ build/
.vscode/* .vscode/*
.vs
*.exe
@@ -1,76 +0,0 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2010-2019 Intel Corporation
*/
/*++
@file: GetControlModeCommand.h
--*/
#ifndef __GET_CONTROL_MODE_COMMAND_H__
#define __GET_CONTROL_MODE_COMMAND_H__
#include "AMTHICommand.h"
#include "MEIparser.h"
namespace Intel
{
namespace MEI_Client
{
namespace AMTHI_Client
{
struct GET_CONTROL_MODE_RESPONSE
{
uint32_t ControlMode;
void parse (std::vector<uint8_t>::const_iterator& itr, const std::vector<uint8_t>::const_iterator end)
{
Intel::MEI_Client::parseData(*this, itr, end);
}
};
class GetControlModeRequest;
class GetControlModeCommand : public AMTHICommand
{
public:
GetControlModeCommand();
virtual ~GetControlModeCommand() {}
virtual void reTransact();
GET_CONTROL_MODE_RESPONSE getResponse();
private:
virtual void parseResponse(const std::vector<uint8_t>& buffer);
std::shared_ptr<AMTHICommandResponse<GET_CONTROL_MODE_RESPONSE>> m_response;
static const uint32_t RESPONSE_COMMAND_NUMBER = 0x0480006B;
};
class GetControlModeRequest : public AMTHICommandRequest
{
public:
GetControlModeRequest() {}
virtual ~GetControlModeRequest() {}
private:
static const uint32_t REQUEST_COMMAND_NUMBER = 0x0400006B;
virtual unsigned int requestHeaderCommandNumber()
{
//this is the command number (taken from the AMTHI document)
return REQUEST_COMMAND_NUMBER;
}
virtual uint32_t requestDataSize()
{
return 0;
}
virtual std::vector<uint8_t> SerializeData();
};
} // namespace AMTHI_Client
} // namespace MEI_Client
} // namespace Intel
#endif //__GET_CONTROL_MODE_COMMAND_H__
-51
View File
@@ -1,51 +0,0 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2010-2019 Intel Corporation
*/
/*++
@file: GetControlModeCommand.cpp
--*/
#include "GetControlModeCommand.h"
#include "StatusCodeDefinitions.h"
#include <string.h>
using namespace std;
using namespace Intel::MEI_Client::AMTHI_Client;
GetControlModeCommand::GetControlModeCommand()
{
shared_ptr<MEICommandRequest> tmp(new GetControlModeRequest());
m_request = tmp;
Transact();
}
void GetControlModeCommand::reTransact()
{
shared_ptr<MEICommandRequest> tmp(new GetControlModeRequest());
m_request = tmp;
Transact();
}
GET_CONTROL_MODE_RESPONSE GetControlModeCommand::getResponse()
{
return m_response->getResponse();
}
void
GetControlModeCommand::parseResponse(const vector<uint8_t>& buffer)
{
shared_ptr<AMTHICommandResponse<GET_CONTROL_MODE_RESPONSE>> tmp(
new AMTHICommandResponse<GET_CONTROL_MODE_RESPONSE>(buffer, RESPONSE_COMMAND_NUMBER));
m_response = tmp;
}
std::vector<uint8_t>
GetControlModeRequest::SerializeData()
{
vector<uint8_t> output;
return output;
}
+101
View File
@@ -0,0 +1,101 @@
# Remote Provisioning Client (RPC)
RPC is an application which enables remote capabilities for AMT, such as as device activation. To accomplish this, RPC communicates with the RPS (Remote Provisioning Server).
The steps below assume the following directory structure where **rpc** is the clone of this repository, **vcpkg** is a clone of the VCPKG tool source and **build** is the RPC build directory. Both vcpkg and build directories will be created in later steps.
```
\rpc
|__vcpkg
|__build
```
# Linux
Steps below are for Ubuntu 18.04 and 20.04.
## Dependencies
```
sudo apt install git cmake build-essential curl zip unzip tar pkg-config
```
## Build C++ REST SDK
Open a Terminal window.
```
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install cpprestsdk[websockets]
```
## Build RPC
Open a Terminal window.
```
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
```
To build debug:
```
cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
```
## Run RPC
Open a Terminal window.
```
cd build
sudo ./rpc --url wss://localhost:8080 --cmd "-t activate --profile profile1"
```
Use --help for more options.
# Windows
Steps below are for Windows 10 and Visual Studio 2019 Professional.
## Build C++ REST SDK
Open an x64 Native Tools Command Prompt for Visual Studio 2019.
```
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg install cpprestsdk[websockets]:x64-windows-static
```
## Build RPC
Open an x64 Native Tools Command Prompt for Visual Studio 2019.
```
mkdir build
cd build
cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --config Release
```
To build debug:
```
cmake --build . --config Debug
```
## Run RPC
Open a Command Prompt as Administrator.
```
cd build\Release
rpc.exe --url wss://localhost:8080 --cmd "-t activate --profile profile1"
```
Use --help for more options.
+50
View File
@@ -0,0 +1,50 @@
<a name="v1.2.0"></a>
## v1.2.0
### Ci
- breakout docker build for merge only
### Feat
- update RPC version to 1.2.0.
- BREAKING CHANGE: add heartbeat capability, bump RPC Protocol version to 4.0.0
- add unit test framework
- add hostname to activation info
- **docker:** add dockerfile support for RPC
### Fix
- use message status instead, cleanup message fields.
<a name="v1.1.0"></a>
## [v1.1.0] - 2021-02-09
### Build
- **jenkins:** jenkins build scripts for Windows and Ubuntu
- add support for centos7 and 8
- Use `-DNO_SELECT=ON` to work around select behavior on older distros
- Use vcpkg for both linux and windows
### Ci
- update build
- update build
- add support for release or debug
- add types for conventional commits
- add ci for status checks
### Docs
- add release disclaimer
### Fix
- link status not reported correctly
- free fqdn buffer
### Feat
- version update
- Add `--nocertcheck`, `-n` args to skip websocket server certificate verification for all builds.
- Add/update DNS Suffix (OS), Hostname (OS), fqdn [AMT] and DNS Suffix info returned by --amtinfo.
<a name="v1.0.0"></a>
## [v1.0.0] - 2020-11-20
### Build
- Add Github Actions Support
+81 -67
View File
@@ -1,18 +1,14 @@
cmake_minimum_required (VERSION 3.1) cmake_minimum_required (VERSION 3.1)
project (rpc VERSION 1.0.0) project (rpc VERSION 1.2.0)
set (CMAKE_CXX_STANDARD 11) set (CMAKE_CXX_STANDARD 11)
# RPC version info # RPC version info
configure_file(version.h.in configure_file(version.h.in version.h)
version.h)
include_directories(${PROJECT_BINARY_DIR}) include_directories(${PROJECT_BINARY_DIR})
# TODO: figure out how to read the LMS version from repo like the main lms CMakeLists.txt # Common compiler settings
set (LMS_VERSION_STRING 1932.0.0.0)
# Compiler settings [Obtained from CmakeLists.txt for lms]
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -D_DEBUG") string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -D_DEBUG")
string(APPEND CMAKE_C_FLAGS_DEBUG " -DDEBUG -D_DEBUG") string(APPEND CMAKE_C_FLAGS_DEBUG " -DDEBUG -D_DEBUG")
@@ -27,11 +23,10 @@ if (UNIX)
#Secure library usage and secure compile flags #Secure library usage and secure compile flags
add_definitions (-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -Wformat -Wformat-security) add_definitions (-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -Wformat -Wformat-security)
add_definitions (-fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv) add_definitions (-fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -fpermissive)
else (UNIX) else (UNIX)
add_definitions (/GS /sdl) add_definitions (/GS /sdl)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NXCompat /DynamicBase") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NXCompat /DynamicBase")
#add_definitions (/D UNICODE /D _UNICODE)
add_definitions (/D UNICODE /D _UNICODE /D_NO_ASYNCRTIMP /D_ASYNCRT_EXPORT /D_NO_PPLXIMP /DWIN32 /DMBCS /D_USRDLL /DCPPREST_EXCLUDE_COMPRESSION /D_WINSOCK_DEPRECATED_NO_WARNINGS) add_definitions (/D UNICODE /D _UNICODE /D_NO_ASYNCRTIMP /D_ASYNCRT_EXPORT /D_NO_PPLXIMP /DWIN32 /DMBCS /D_USRDLL /DCPPREST_EXCLUDE_COMPRESSION /D_WINSOCK_DEPRECATED_NO_WARNINGS)
add_compile_options ($<$<CONFIG:Release>:/O2>) add_compile_options ($<$<CONFIG:Release>:/O2>)
add_compile_options (/MT$<$<CONFIG:Debug>:d>) add_compile_options (/MT$<$<CONFIG:Debug>:d>)
@@ -39,93 +34,112 @@ else (UNIX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif (UNIX) endif (UNIX)
# Add MicroLMS directly to our build. This adds
# Download and unpack lms at configure time # the following targets: MicroLMS
configure_file(lms.cmake.in add_subdirectory(MicroLMS)
lms-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lms-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lms-download )
# Add MEIClient directly to our build. This adds
# the following targets: LmsMEIClient and LIBMETEE
add_subdirectory(${CMAKE_BINARY_DIR}/lms-src/MEIClient
${CMAKE_BINARY_DIR}/lms-build/MEIClient)
add_dependencies(LmsMEIClient libmetee)
if (UNIX)
# Find threads [unix it pthreads]
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
# Find Boost
find_package(Boost COMPONENTS system REQUIRED)
# Find OpenSSL
find_package(OpenSSL)
# Download and build CppRestSDK, If GIT_TAG is changed then need to delete cpprestsdk-prefix because UPDATE_COMMAND is set to ""
include(ExternalProject)
ExternalProject_Add(cpprestsdk
GIT_REPOSITORY https://github.com/Microsoft/cpprestsdk.git
GIT_TAG v2.10.14
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=<SOURCE_DIR>/../../install
TEST_COMMAND ""
UPDATE_COMMAND ""
)
ExternalProject_Get_Property(cpprestsdk SOURCE_DIR)
set(CPPRESTSDK_LIBARIES ${SOURCE_DIR}/../../install/lib/)
set(CPPRESTSDK_INCLUDE_DIR ${SOURCE_DIR}/../../install/include/)
add_library(cpprest INTERFACE)
target_link_libraries(cpprest INTERFACE ${CPPRESTSDK_LIBARIES}/libcpprest.a OpenSSL::SSL OpenSSL::Crypto ${Boost_LIBRARIES} Threads::Threads)
target_include_directories(cpprest INTERFACE ${CPPRESTSDK_INCLUDE_DIR})
else (UNIX)
# CppRestSDK # CppRestSDK
find_package(cpprestsdk CONFIG REQUIRED) find_package(cpprestsdk CONFIG REQUIRED)
endif (UNIX) # GoogleTest
# Download and unpack googletest at configure time
configure_file(googletest.cmake.in googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
${CMAKE_CURRENT_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
# add the test executable
add_executable(rpctest
test.cpp
utils.cpp
)
target_link_libraries(rpctest
gtest_main
cpprestsdk::cpprest
cpprestsdk::cpprestsdk_zlib_internal
cpprestsdk::cpprestsdk_boost_internal
cpprestsdk::cpprestsdk_openssl_internal
)
# ccu-poc # ccu-poc
add_executable (rpc add_executable (rpc
AMTHIClient/Include/GetControlModeCommand.h info.h
AMTHIClient/Src/GetControlModeCommand.cpp info.cpp
args.h
args.cpp
usage.h
usage.cpp
port.h
utils.h
utils.cpp
network.h
network.cpp
commands.h commands.h
commands.cpp commands.cpp
activation.h
activation.cpp
heartbeat.h
heartbeat.cpp
lms.h lms.h
lms.cpp lms.cpp
main.cpp main.cpp
) )
target_include_directories(rpc PUBLIC target_include_directories(rpc PUBLIC
"AMTHIClient/Include/" "MicroLMS/heci"
) )
add_dependencies(rpc MicroLMS)
if (UNIX) if (UNIX)
add_dependencies(rpc cpprestsdk)
target_link_libraries (rpc PRIVATE target_link_libraries (rpc PRIVATE
LmsMEIClient MicroLMS
cpprest cpprestsdk::cpprest
cpprestsdk::cpprestsdk_zlib_internal
cpprestsdk::cpprestsdk_boost_internal
cpprestsdk::cpprestsdk_openssl_internal
) )
else (UNIX) else (UNIX)
target_link_libraries (rpc PRIVATE target_link_libraries (rpc PRIVATE
LmsMEIClient MicroLMS
iphlpapi
cpprestsdk::cpprest cpprestsdk::cpprest
cpprestsdk::cpprestsdk_zlib_internal cpprestsdk::cpprestsdk_zlib_internal
cpprestsdk::cpprestsdk_boost_internal cpprestsdk::cpprestsdk_boost_internal
cpprestsdk::cpprestsdk_brotli_internal cpprestsdk::cpprestsdk_brotli_internal
${Boost_LIBRARIES} DbgHelp.lib
Iphlpapi.lib
Setupapi.lib
ws2_32.lib
Psapi.lib
Crypt32.lib
Wintrust.lib
Version.lib
Wtsapi32.lib
Gdiplus.lib
Userenv.lib
) )
endif (UNIX) endif (UNIX)
+85
View File
@@ -0,0 +1,85 @@
# Remote Provisioning Client (RPC)
RPC is an application which enables remote capabilities for AMT, such as as device activation. To accomplish this, RPC communicates with the RPS (Remote Provisioning Server).
The steps below assume the following directory structure where **rpc** is the clone of this repository, **vcpkg** is a clone of the VCPKG tool source and **build** is the RPC build directory. Both vcpkg and build directories will be created in later steps.
```
\rpc
|__vcpkg
|__build
```
# Linux
Steps below are for CentOS7.
**The "export PATH=..." (for CMake and Git), and "scl enable devtoolset-7 bash" (for GCC) must be executed in in the Terminal you are building from; i.e. these are temporary changes which only affect the current Terminal session.**
## Dependencies
### CMake
Download cmake-3.10.2-Linux-x86_64.sh from https://github.com/Kitware/CMake/releases/tag/v3.10.2.
```
./cmake-3.10.2-Linux-x86_64.sh
export PATH=/home/user/Downloads/cmake-3.10.2-Linux-x86_64/bin:$PATH
```
### GCC
Update GCC toolchain.
```
sudo yum install centos-release-scl
sudo yum install devtoolset-7
scl enable devtoolset-7 bash
```
### Git
Build Git source control system.
```
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel
git clone https://github.com/git/git.git
make configure
make
export PATH=/home/user/Downloads/git:$PATH
```
## Build C++ REST SDK
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
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install cpprestsdk[websockets]
```
## Build RPC
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
```
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DNO_SELECT=ON ..
cmake --build .
```
To build debug:
```
cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DNO_SELECT=ON ..
cmake --build .
```
## Run RPC
Open a Terminal window.
```
cd build
sudo ./rpc --url wss://localhost:8080 --cmd "-t activate --profile profile1"
```
Use --help for more options.
+63
View File
@@ -0,0 +1,63 @@
# Remote Provisioning Client (RPC)
RPC is an application which enables remote capabilities for AMT, such as as device activation. To accomplish this, RPC communicates with the RPS (Remote Provisioning Server).
The steps below assume the following directory structure where **rpc** is the clone of this repository, **vcpkg** is a clone of the VCPKG tool source and **build** is the RPC build directory. Both vcpkg and build directories will be created in later steps.
```
\rpc
|__vcpkg
|__build
```
# Linux
Steps below are for CentOS8.
## Dependencies
### CMake
Install CMake.
```
sudo yum install cmake
```
## Build C++ REST SDK
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
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install cpprestsdk[websockets]
```
## Build RPC
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
```
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
```
To build debug:
```
cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
```
## Run RPC
Open a Terminal window.
```
cd build
sudo ./rpc --url wss://localhost:8080 --cmd "-t activate --profile profile1"
```
Use --help for more options.
+37
View File
@@ -0,0 +1,37 @@
#*********************************************************************
# Copyright (c) Intel Corporation 2021
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
FROM ubuntu:groovy-20210416 AS rpc-builder
WORKDIR /
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update -y -qq && \
apt install -y -qq \
git cmake build-essential libssl-dev zlib1g-dev \
curl unzip zip pkg-config ca-certificates
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 cd vcpkg && ./bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install cpprestsdk[websockets]
WORKDIR /rpc/build
RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake ..
RUN cmake --build .
FROM ubuntu:groovy-20210416
LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2021: Intel'
WORKDIR /root
RUN \
apt-get update -y -qq && \
apt install -y -qq \
libssl-dev
COPY --from=rpc-builder /rpc/build/rpc .
ENTRYPOINT ["/root/rpc"]
Vendored
+172
View File
@@ -0,0 +1,172 @@
pipeline {
agent none
triggers {cron '@daily'}
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 {
script {
scmCheckout {
clean = true
}
}
}
}
}
}
stage ('Windows') {
agent { label 'openamt-win' }
stages {
stage ('Cloning Repository') {
steps {
script {
scmCheckout {
clean = true
}
}
}
}
}
}
}
}
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') {
agent { label 'docker-amt' }
stages {
stage('Build') {
agent {