Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e5a3f802f3 | |||
| 39ddea389a | |||
| 9aa745e5a2 | |||
| 38c8bc2384 | |||
| 584ca67799 | |||
| cf7fac325f | |||
| 8569684593 | |||
| 1e72b281a5 | |||
| 75673aa373 | |||
| 5772e831ad | |||
| 67202dc5d3 | |||
| 6d490aec65 | |||
| 41f8f8553c | |||
| bc1f8d0cfb | |||
| a8e1bc89f0 | |||
| 5b5a480943 | |||
| a190a214f1 | |||
| 54b7550e31 | |||
| e4deeca506 | |||
| 365ad90adc | |||
| 2984880b6e | |||
| da9c26bc26 | |||
| bb4e144684 | |||
| 86cf9657ad | |||
| 025152f359 | |||
| 9b0d7fe649 | |||
| b2a54c47a3 | |||
| a859cf5648 | |||
| 5a9597fc2b | |||
| b1f7b32baa | |||
| 2fb64ac3f8 | |||
| b03e2988a5 | |||
| acf428537f | |||
| 6cd660a7af | |||
| c4de327e7e | |||
| fc600d61a1 | |||
| 41a1be5249 | |||
| 4e5dccce89 | |||
| 0679235cba | |||
| 95a422478b | |||
| f9f70d23f9 | |||
| f1b32ef953 | |||
| d23b1c4be5 | |||
| b54025168c | |||
| 6433a553a0 | |||
| b13c070598 | |||
| ecc31a25f7 | |||
| 01316bcfa2 | |||
| c1fbf6aa39 | |||
| fd5817461e | |||
| a889f91cdc | |||
| a32e109913 | |||
| 9efc9476a4 | |||
| aa7d888fab | |||
| aa68d7cfdb | |||
| 434c9a1cc2 | |||
| 8b4f3b00bb | |||
| 53bc0c42da | |||
| dbb825c49e | |||
| 385ea2b9c3 | |||
| 0ecd6c9911 | |||
| ca85fa4d14 | |||
| 711d9ef58d | |||
| 458d6ba2e2 | |||
| d2633af0c5 | |||
| 3bfb88aeb6 | |||
| d22f00ec0b | |||
| cd4046c741 | |||
| 584a8e4f34 | |||
| 1fc6816153 | |||
| a5788382d7 | |||
| f5aa168acb | |||
| a2c396bae1 | |||
| bbf9ea967b | |||
| 722a97958f | |||
| 6d2e37e7fc | |||
| eb42f1e89d | |||
| 23fe0e1663 | |||
| 958096a375 |
@@ -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 -}}
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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 .
|
||||||
@@ -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
|
||||||
@@ -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__
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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.
|
||||||
|
|
||||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 {
|
||||||
|
|||||||