「🏗️」 wip: TODO
This commit is contained in:
15
flake.nix
15
flake.nix
@ -55,6 +55,21 @@
|
|||||||
apps = forEachSupportedSystem (
|
apps = forEachSupportedSystem (
|
||||||
{ pkgs, system }:
|
{ pkgs, system }:
|
||||||
{
|
{
|
||||||
|
virtualBoyy =
|
||||||
|
let
|
||||||
|
scriptName = "run-virtualBoyy-vm";
|
||||||
|
script = pkgs.writeShellScriptBin "${scriptName}" ''
|
||||||
|
${inputs.keyzconf.packages.${system}.virtualBoyy { mount-enabled = true; }}/bin/run-virtualBoyy-vm \
|
||||||
|
-enable-kvm \
|
||||||
|
-m 8G \
|
||||||
|
-smp 4 \
|
||||||
|
-virtfs local,path=$(${pkgs.coreutils}/bin/pwd),mount_tag=host0,id=host0,security_model=none
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
type = "app";
|
||||||
|
program = "${script}/bin/${scriptName}";
|
||||||
|
};
|
||||||
virtualBoyy-headless =
|
virtualBoyy-headless =
|
||||||
let
|
let
|
||||||
scriptName = "run-virtualBoyy-vm-headless";
|
scriptName = "run-virtualBoyy-vm-headless";
|
||||||
|
@ -49,6 +49,7 @@ void process_icmp(char *buf, int bytes, struct sockaddr_in *addr, int seq,
|
|||||||
|
|
||||||
append_time(rtt);
|
append_time(rtt);
|
||||||
|
|
||||||
|
// TODO: fix the time and put the hostname with the ip
|
||||||
printf("%d bytes from %s: icmp_seq=%d ttl=%d time=%.3f\n", bytes - len,
|
printf("%d bytes from %s: icmp_seq=%d ttl=%d time=%.3f\n", bytes - len,
|
||||||
inet_ntoa(addr->sin_addr), icmp->icmp_seq, ip->ip_ttl, rtt);
|
inet_ntoa(addr->sin_addr), icmp->icmp_seq, ip->ip_ttl, rtt);
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ int send_ping(int socket, struct sockaddr_in *dest, options_t opt) {
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: fix this shitty loop
|
||||||
int ping(args_t *args) {
|
int ping(args_t *args) {
|
||||||
int ret;
|
int ret;
|
||||||
options_t opt = init_opt(args);
|
options_t opt = init_opt(args);
|
||||||
|
@ -61,10 +61,12 @@ bool check_for_timeout(struct timeval start, options_t opt) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: fix the packet loss
|
||||||
void print_stats(void) {
|
void print_stats(void) {
|
||||||
printf("--- %s ping statistics ---\n", address);
|
printf("--- %s ping statistics ---\n", address);
|
||||||
printf("%d packets transmitted, %d packets received, %.0f%% packet loss\n",
|
printf("%d packets transmitted, %d packets received, %.0f%% packet loss\n",
|
||||||
tx_count, rx_count, (tx_count - rx_count / 2.0) * 100);
|
tx_count, rx_count, (tx_count - rx_count / 2.0) * 100);
|
||||||
|
// TODO: fix this shit
|
||||||
printf("round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f\n",
|
printf("round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f\n",
|
||||||
get_min_rtt(), get_avg_rtt(), get_max_rtt(), get_stddev_rtt());
|
get_min_rtt(), get_avg_rtt(), get_max_rtt(), get_stddev_rtt());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user