igmpgen/src/usage.c
Glenn Y. Rolland c92f1580df
Some checks failed
continuous-integration/drone/push Build is failing
chore: re-indent code (linux style)
2023-12-27 10:24:06 +01:00

37 lines
1.1 KiB
C

#include <string.h>
#include <sys/types.h>
#include <stdio.h>
#include "ipg_types.h"
void usage(const char *name)
{
ipg_igmp_extra_t *pkt_ptr;
fprintf(stderr, "Usage: %s [options]\n", basename(name));
fprintf(stderr, "\nOptions:\n");
fprintf(stderr,
" -i <interface> Specify the network interface (e.g., eth0)\n");
fprintf(stderr,
" -t <type> Specify the IGMP packet type and version (e.g., 1.query)\n");
fprintf(stderr,
" -g <group> Specify the destination IGMP group (e.g., 224.0.0.1)\n");
fprintf(stderr,
" -s <source> Specify the source IP and port (e.g., 192.168.1.1:1234)\n");
fprintf(stderr,
" -d <destination> Specify the destination IP and port (e.g., 224.0.0.2:5678)\n");
fprintf(stderr,
" -n <number> Specify delay between packets in seconds (optional)\n");
fprintf(stderr, "\nAvailable IGMP packet types:\n");
pkt_ptr = g_igmp_pkts;
while (pkt_ptr->igmp_version || pkt_ptr->igmp_tag) {
fprintf(stderr, " - %d.%s\n", pkt_ptr->igmp_version,
pkt_ptr->igmp_tag);
pkt_ptr++;
}
fprintf(stderr, "\n");
}