forked from Consti10/wifibroadcast
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
29 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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Created by consti10 on 07.01.24. | ||
// | ||
|
||
#include "DummyLink.h" | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <sys/mman.h> | ||
|
||
void* create_shared_memory(size_t size) { | ||
// Our memory buffer will be readable and writable: | ||
int protection = PROT_READ | PROT_WRITE; | ||
|
||
// The buffer will be shared (meaning other processes can access it), but | ||
// anonymous (meaning third-party processes cannot obtain an address for it), | ||
// so only this process and its children will be able to use it: | ||
int visibility = MAP_SHARED | MAP_ANONYMOUS; | ||
|
||
// The remaining parameters to `mmap()` are not important for this use case, | ||
// but the manpage for `mmap` explains their purpose. | ||
return mmap(NULL, size, protection, visibility, -1, 0); | ||
} | ||
|
||
|
||
void DummyLink::tx_radiotap(const uint8_t *packet_buff, int packet_size) { | ||
|
||
} | ||
|
||
void DummyLink::rx_radiotap() { | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Created by consti10 on 07.01.24. | ||
// | ||
|
||
#ifndef OPENHD_DUMMYLINK_H | ||
#define OPENHD_DUMMYLINK_H | ||
|
||
#include <cstdint> | ||
|
||
class DummyLink { | ||
public: | ||
void tx_radiotap(const uint8_t* packet_buff, int packet_size); | ||
void rx_radiotap(); | ||
private: | ||
bool m_is_air; | ||
}; | ||
|
||
|
||
#endif //OPENHD_DUMMYLINK_H |