/ inc / server.h
server.h
 1  /**
 2   * @file server.h
 3   * @author your name (you@domain.com)
 4   * @brief ldap server implementation
 5   * @version 0.1
 6   * @date 2023-11-19
 7   *
 8   * @copyright Copyright (c) 2023
 9   *
10   */
11  #ifndef SERVER_H
12  #define SERVER_H
13  #include "inc/BerEnumObject.h"
14  #include "inc/BerIntObject.h"
15  #include "inc/BerObject.h"
16  #include "inc/BerParser.h"
17  #include "inc/BerSequenceObject.h"
18  #include "inc/BerSetObject.h"
19  #include "inc/BerStringObject.h"
20  #include "inc/DatabaseObject.h"
21  #include "inc/FilterObject.h"
22  #include "inc/argument_helper_functions.h"
23  #include "inc/ldap_comunication.h"
24  #include <arpa/inet.h>
25  #include <fcntl.h>
26  #include <netinet/in.h>
27  #include <stdio.h>
28  #include <stdlib.h>
29  #include <string.h>
30  #include <sys/resource.h>
31  #include <sys/socket.h>
32  #include <sys/time.h>
33  #include <sys/types.h>
34  #include <sys/wait.h>
35  #include <unistd.h>
36  
37  // Macro for printing err message and closing socket when err != 0
38  #define CHECK_ERR(err, msg)                                                    \
39    if (err != 0) {                                                              \
40      printf("%s\n", msg);                                                       \
41      close(childSocket);                                                        \
42      exit(0);                                                                   \
43    }
44  
45  int ldapServer(int port, char *dbPath);
46  
47  #endif