Aker is an experimental MAC address blocking scheduler.
For details:
https://github.com/Comcast/aker/wiki
mkdir build
cd build
cmake ..
make
make test
Aker is an experimental MAC address blocking scheduler.
License: Apache License 2.0
Aker is an experimental MAC address blocking scheduler.
For details:
https://github.com/Comcast/aker/wiki
mkdir build
cd build
cmake ..
make
make test
Processing of recurring times will not occur until all valid absolute unix time schedules are all past.
Also have to change references to the branch in .travis.yml, README, and CONTRIBUTING. Double check any other markdown files as well - sometimes links have the branch name in them.
The binary payload below is not being interpreted correctly and is being discarded:
84 A9 74 69 6D 65 5F 7A 6F 6E 65 B0 41 6D 65 72 69 63 61 2F 4E 65 77 5F 59 6F 72 6B A6 77 65 65 6B 6C 79 93 82 A4 74 69 6D 65 0A A7 69 6E 64 65 78 65 73 93 00 01 03 82 A4 74 69 6D 65 14 A7 69 6E 64 65 78 65 73 91 00 82 A4 74 69 6D 65 1E A7 69 6E 64 65 78 65 73 C0 A4 6D 61 63 73 94 B1 31 31 3A 32 32 3A 33 33 3A 34 34 3A 35 35 3A 61 61 B1 32 32 3A 33 33 3A 34 34 3A 35 35 3A 36 36 3A 62 62 B1 33 33 3A 34 34 3A 35 35 3A 36 36 3A 37 37 3A 63 63 B1 34 34 3A 35 35 3A 36 36 3A 37 37 3A 38 38 3A 64 64 A8 61 62 73 6F 6C 75 74 65 91 82 A9 75 6E 69 78 5F 74 69 6D 65 CE 59 E5 83 17 A7 69 6E 64 65 78 65 73 92 00 02
Current behavior: Aker tries to Parodus once and gives up if unsuccessful.
Desired behavior: Aker should try connecting to Parodus again using back off retry logic
time_zone
type string to MsgPack structureSuggested place to start:
int main (int argc, char *argv[])
{
struct tm *mt;
time_t mtt;
char ftime[10];
setenv("TZ", "America/New_York", 1);
tzset();
mtt = time(NULL);
mt = localtime(&mtt);
strftime(ftime,sizeof(ftime),"%Z %H%M",mt);
printf("%s\n", ftime);
}
We should use key names to process the input file, not just key
:value type
combos. This will make the code significantly more robust.
It would be awesome to be able to get how to use the cli via -h
Right now the actual converter does nothing, but the unixtime to weekly time needs to be finished. Of note - we need to ensure that the time changes are accounted for correctly.
Correct behavior for the time change:
If a duplicate time entry is specified it can result in an infinite loop. Below is an example of how to cause the problem:
char decode_buffer_4[] = "\x85"
"\xa6""weekly"
"\x95"
"\x82"
"\xa4""time" /*: */ "\x0a"
"\xa7""indexes"
"\x93" /* [ */ "\x00" "\x01" "\x03" /* ] */
"\x82"
"\xa4""time" /*: */ "\x14"
"\xa7""indexes"
"\x92" /* [ */ "\x00" "\x04" /* ] */
"\x82"
"\xa4""time" /*: */ "\x1e"
"\xa7""indexes" "\xc0"
"\x82"
"\xa4""time" /*: */ "\x28"
"\xa7""indexes"
"\x91" /* [ */ "\x00" /* ] */
"\x82"
"\xa4""time" /*: */ "\x0a" /*<----- Duplicate time that causes the infinite loop */
"\xa7""indexes"
"\x93" /* [ */ "\x03" "\x05" "\xcd\x03\x8f" /* ] */
"\xa4""macs"
"\x9a"
"\xb1""11:22:33:44:55:aa"
"\xb1""22:33:44:55:66:bb"
"\xb1""33:44:55:66:77:cc"
"\xb1""44:55:66:77:88:dd"
"\xb1""55:33:44:55:66:bb"
"\xb1""66:44:55:66:77:cc"
"\xb1""77:55:66:77:88:dd"
"\xb1""88:33:44:55:66:bb"
"\xb1""99:44:55:66:77:cc"
"\xb1""00:55:66:77:88:dd"
"\xa8""absolute"
"\x91"
"\x82"
"\xa9""unix_time" /* : */ "\xce""\x5a\x0b\x4a\xa8"
"\xa7""indexes" /* : */ "\x93" /* [ */ "\x00" "\x02" "\x09" /* ] */
"\xab""report_rate" /* : */ "\xcd""\x0e\x10"
"\xa6""ignore" /* : */ "\xae""this parameter";
Scheduling function needs to be done
For devices that do not have space for the entire tzdata, we need a mechanism for supplying the zoneinfo file. We need to add the following:
[ ] add an optional value to the payload named zoneinfo
field that expects a binary blob
[ ] add to the command line interface an option: --overwrite-zoneinfo dir
If the --overwrite-zone
directory is specified and the zoneinfo
field is present in the /aker/schedule
request, then the blob specified will be written as the file: ${cli-dir}/${time_zone}
where ${cli-dir}
is the directory name specified with the --overwrite-zone
option and the ${time_zone}
is the string specified in the schedule.
This behavior should be performed each time the schedule is set.
If the schedule is deleted, the file should also be deleted.
If the --overwrite-zone
option is not specified, Aker should happily use what POSIX and friends gives us.
If an empty list is passed for weekly
or absolute
the schedule is not accepted as part of the logic added to prevent the infinite loop.
We would like to better understand how well Aker is performing. To enable this understanding we'd like to collect the following:
The reporting times may be added to the schedule so the cloud can coordinate the events.
Below is an example schema represented in JSON for clarity, then MsgPack for accuracy.
ps
- required - The unix time the process started running. This should not change except when the process is restarted.id
- required - The device-id running this instance of Aker.rows
- required - The array of rows of data. The default is to provide the last 3 data points (typically 24h worth of data).ts
- required - The unix time of the data set in UTC time.off
- required - The offset in seconds based on the schedule specified timezone.dbc
- required - The device block count is the number of device ids that have been blocked since the program started.wtc
- required - The window transition count is the number of times a transition between defined blocking windows has been encountered since the program started.ssc
- required - The schedule set count is the number of times a schedule has been set since the program started.md5
- required - The md5 check failure count is the number of times the md5 did not match the file since the program started.tz
- required - The timezone string is the most recently specified timezone from the schedule in effect.{
"ps": 1622763073,
"id": "mac:112233445566",
"rows": [
{
"ts": 1622761073,
"off": 28800,
"dbc": 5312,
"wtc": 204,
"ssc": 3,
"md5": 0,
"tz": "PST8PDT"
}, {
"ts": 1622674673,
"off": 28800,
"dbc": 4612,
"wtc": 123,
"ssc": 2,
"md5": 0,
"tz": "PST8PDT"
}, {
"ts": 1622588273,
"off": 28800,
"dbc": 2212,
"wtc": 54,
"ssc": 1,
"md5": 0,
"tz": "PST8PDT"
}
]
}
Hex MsgPack:
00000000: 82a2 7073 ce60 aeac 29a4 726f 7773 9387 ..ps.`..).rows..
00000010: a274 73ce 60b9 5e71 a36f 6666 cd70 80a3 .ts.`.^q.off.p..
00000020: 6462 63cd 14c0 a377 7463 cccc a373 7363 dbc....wtc...ssc
00000030: 03a3 6d64 3500 a274 7aa7 5053 5438 5044 ..md5..tz.PST8PD
00000040: 5487 a274 73ce 60b8 0cf1 a36f 6666 cd70 T..ts.`....off.p
00000050: 80a3 6462 63cd 1204 a377 7463 7ba3 7373 ..dbc....wtc{.ss
00000060: 6302 a36d 6435 00a2 747a a750 5354 3850 c..md5..tz.PST8P
00000070: 4454 87a2 7473 ce60 b6bb 71a3 6f66 66cd DT..ts.`..q.off.
00000080: 7080 a364 6263 cd08 a4a3 7774 6336 a373 p..dbc....wtc6.s
00000090: 7363 01a3 6d64 3500 a274 7aa7 5053 5438 sc..md5..tz.PST8
000000a0: 5044 54 PDT
If the user makes a Request CRUD call that hits /aker/active/now
, aker should return the list of mac addresses blocked at this moment.
We want to make sure that the log messages are useful and helpful when debugging problems. We need to ensure they are valuable and not too chatty.
https://github.com/Comcast/aker/blob/e5afc7830e0df776a62b8351d43ee07d82c3409e/src/main.c#L239
Add this function as patch in yocto and not here
Per a request, we need to rename weekly-schedule
to weekly
and absolute-schedule
to absolute
.
We want to calculate the MD5 checksum and store it on disk upon receipt and storage of the file. Upon reading of the data file from disk, we want to re-check the MD5 to ensure the data was not corrupted.
Instead of having a hard coded limit, it should come in via a command line option: max-macs
.
If not specified or specified to 0
, then there is no limit. The size of the index
for each entry will be verified to be less then the limit specified.
Change service name from parental-control
to aker
.
schedule {
s->mac_count: 3
[0]: '11:22:33:44:55:66'
[1]: '22:33:44:55:66:aa'
[2]: '33:44:55:66:aa:BB'
s->absolute:
time: ????, block_count: 2 [2, 1] #absolute time of week time 25
time: ????, block_count: 1 [2] #absolute time of week time 32
s->weekly:
time: 0, block_count: 0 [] <---- implied - this is wrong, we should imply the last weekly scheduled event
time: 23, block_count: 1 [0]
time: 30, block_count: 1 [1]
}
There should be no implied event at time 0 for the relative schedule. Instead we want to use the last time from the previous week are in place until the first event.
/aker/service/version/upstream
should return the github repo commit hash in msgpack format like:
{
"upstream": "8c310fcae2a35fd1dc139584ce9d5b289736e1a8"
}
Right now the schedule polls every 5 seconds to check if is time to process a schedule. Instead, change to use pthread based conditional variable visible to other threads also, especially when a change to the schedule is received.
Measure the amount of time taken to process each time slot and output into log. This will be a useful metric to have.
We need to ensure that we support arrays that are:
Without unintended side effects (like crashing).
The CRUD request is not responded to immediately (or at all from what I can tell).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.