-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_agent.c
34 lines (26 loc) · 886 Bytes
/
main_agent.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# include <stdio.h>
# include <stdlib.h>
# include "shared/utils.h"
# include "shared/buffer_manager.h"
# include "agent/agent.h"
void printUsageInformation(const char *program_name)
{
printf("\n*************************************************************************************************\n");
printf("* " INFORMATIONAL "[*] " RESET "Usage: %s <PORT> <SERVER_ADDRESS>\t\t\t\t\t\t\t*\n", program_name);
printf("*************************************************************************************************\n");
return;
}
int main(int argc, char *argv[])
{
setBufferingMode();
if (argc != 3)
{
printUsageInformation(argv[0]);
return 1;
}
/* TODO: Add parsing functionality for arguments. */
const char *server_ip = argv[1];
int server_port = atoi(argv[2]);
startAgent(server_ip, server_port);
return 0;
}