This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made changes to README instructions and cclient error checking.
Signed-off-by: phansGithub <[email protected]>
- Loading branch information
phansGithub
committed
Oct 4, 2023
1 parent
32ac1d3
commit 89ebed7
Showing
2 changed files
with
57 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
# Compiling the C Library | ||
|
||
## Creating the .h and the .so files: | ||
## Creating the shared library and header files: | ||
|
||
```cmd | ||
go build -o lib_udsclient.so -buildmode=c-shared cclient.go | ||
``` | ||
- this creates the header and shared library files from the cclient.go file. | ||
|
||
```go build -o lib_udsclient.so -buildmode=c-shared cclient.go``` | ||
- this creates .h and .so files from the cclient.go file. | ||
|
||
|
||
## Creating the .h and the .a files: | ||
|
||
```go build -o lib_udsclient.a -buildmode=c-archive ./cclient.go``` | ||
- this creates .h and .a files | ||
|
||
## Creating the the static library and header files: | ||
|
||
```cmd | ||
go build -o lib_udsclient.a -buildmode=c-archive ./cclient.go | ||
``` | ||
- this creates the shared library and header files | ||
|
||
## Usage | ||
|
||
After creating the .h and/or the .a and the .o files as described in the previous steps, | ||
After creating the library and header files as described in the previous steps, | ||
this is how to use the functions generated by cgo | ||
|
||
``` char* GetUdsClientVersion()``` | ||
This returns the version of our handshake on your local machine/client. | ||
```c | ||
char* GetUdsClientVersion() | ||
``` | ||
This returns the version of the handshake on your local machine/client. | ||
|
||
```char* GetUdsServerVersion()``` | ||
This returns the version of our handshake on the server/host. | ||
```c | ||
char* GetUdsServerVersion() | ||
``` | ||
This returns the version of the handshake on the server/host. | ||
|
||
```int RequestXskMapFd(char* device)``` | ||
This requests an Xsk map Fd for a specifed device. | ||
```c | ||
int RequestXskMapFd(char* device) | ||
``` | ||
This requests an xskmap Fd for a specified device. | ||
```int RequestBusyPoll(int busyTimeout, int busyBudget, int fd)``` | ||
```c | ||
int RequestBusyPoll(int busyTimeout, int busyBudget, int fd) | ||
``` | ||
This requests a busy poll for a specific device by using it's fd, and specifying a timeout and a budget. | ||
|
||
```void CleanUpConnection()``` | ||
```c | ||
void CleanUpConnection() | ||
``` | ||
After all the other functions are called, this needs to be called after all the work you need to do is done, | ||
so that the connection to the Uds can be cleaned up. | ||
so that the connection to the UDS can be cleaned up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters