Browse Source

had to rename emalloc and ecalloc to smalloc and scalloc to avoid collition with unit testing library

cecylia 6 years ago
parent
commit
699eaf1cec
7 changed files with 66 additions and 66 deletions
  1. 14 14
      relay_station/crypto.c
  2. 19 19
      relay_station/flow.c
  3. 1 1
      relay_station/packet.c
  4. 21 21
      relay_station/relay.c
  5. 5 5
      relay_station/slitheen.c
  6. 4 4
      relay_station/util.c
  7. 2 2
      relay_station/util.h

+ 14 - 14
relay_station/crypto.c

@@ -582,7 +582,7 @@ int mark_finished_hash(flow *f, uint8_t *hs){
 #if OPENSSL_VERSION_NUMBER >= 0x1010000eL
     ctx = HMAC_CTX_new();
 #else
-    ctx = ecalloc(1, sizeof(HMAC_CTX));
+    ctx = scalloc(1, sizeof(HMAC_CTX));
     HMAC_CTX_init(ctx);
 #endif
     HMAC_Init_ex(ctx, f->key, 16, EVP_sha256(), NULL);
@@ -631,7 +631,7 @@ int compute_master_secret(flow *f){
 
     int ok =1;
 
-    uint8_t *pre_master_secret = ecalloc(1, PRE_MASTER_MAX_LEN);
+    uint8_t *pre_master_secret = scalloc(1, PRE_MASTER_MAX_LEN);
 
     int32_t pre_master_len;
     uint32_t l;
@@ -871,7 +871,7 @@ int compute_master_secret(flow *f){
 #if OPENSSL_VERSION_NUMBER >= 0x1010000eL
         md_ctx = EVP_MD_CTX_new();
 #else
-        md_ctx = ecalloc(1, sizeof(EVP_MD_CTX));
+        md_ctx = scalloc(1, sizeof(EVP_MD_CTX));
         EVP_MD_CTX_init(md_ctx);
 #endif
         EVP_MD_CTX_copy_ex(md_ctx, f->hs_md_ctx);
@@ -1072,11 +1072,11 @@ int PRF(flow *f, uint8_t *secret, int32_t secret_len,
     ctx_tmp = EVP_MD_CTX_new();
     ctx_init = EVP_MD_CTX_new();
 #else
-    ctx = ecalloc(1, sizeof(EVP_MD_CTX));
+    ctx = scalloc(1, sizeof(EVP_MD_CTX));
     EVP_MD_CTX_init(ctx);
-    ctx_tmp = ecalloc(1, sizeof(EVP_MD_CTX));
+    ctx_tmp = scalloc(1, sizeof(EVP_MD_CTX));
     EVP_MD_CTX_init(ctx_tmp);
-    ctx_init = ecalloc(1, sizeof(EVP_MD_CTX));
+    ctx_init = scalloc(1, sizeof(EVP_MD_CTX));
     EVP_MD_CTX_init(ctx_init);
 #endif
     if (ctx == NULL || ctx_tmp == NULL || ctx_init == NULL)
@@ -1200,7 +1200,7 @@ int init_ciphers(flow *f){
     mac_len = EVP_MD_size(f->message_digest);
     int32_t total_len = key_len + iv_len + mac_len;
     total_len *= 2;
-    uint8_t *key_block = ecalloc(1, total_len);
+    uint8_t *key_block = scalloc(1, total_len);
 
     PRF(f, f->master_secret, SSL3_MASTER_SECRET_SIZE,
             (uint8_t *) TLS_MD_KEY_EXPANSION_CONST, TLS_MD_KEY_EXPANSION_CONST_SIZE,
@@ -1311,13 +1311,13 @@ int init_ciphers(flow *f){
     EVP_CIPHER_CTX_ctrl(r_ctx_srvr, EVP_CTRL_GCM_SET_IV_FIXED, EVP_GCM_TLS_FIXED_IV_LEN, write_iv);
 
     /* Set up gcm cipher ctx for partial decryption */
-    AES_KEY *key = ecalloc(1, sizeof(AES_KEY));
+    AES_KEY *key = scalloc(1, sizeof(AES_KEY));
     AES_set_encrypt_key(read_key, EVP_CIPHER_CTX_key_length(r_ctx)*8, key);
     o_gcm = CRYPTO_gcm128_new( key, (block128_f) AES_encrypt);
     f->gcm_ctx_key = key;
 
     iv_len = EVP_CIPHER_CTX_iv_length(r_ctx);
-    f->gcm_ctx_iv = emalloc(iv_len);
+    f->gcm_ctx_iv = smalloc(iv_len);
     f->gcm_ctx_ivlen = iv_len;
     memcpy(f->gcm_ctx_iv, read_iv, EVP_GCM_TLS_FIXED_IV_LEN);
 
@@ -1389,7 +1389,7 @@ void generate_client_super_keys(uint8_t *secret, client *c){
     key_len = EVP_CIPHER_key_length(EVP_aes_256_cbc());
     mac_len = EVP_MD_size(md);
     int32_t total_len = 2*key_len + mac_len;
-    uint8_t *key_block = ecalloc(1, total_len);
+    uint8_t *key_block = scalloc(1, total_len);
 
     PRF(NULL, shared_secret, SLITHEEN_SUPER_SECRET_SIZE,
             (uint8_t *) SLITHEEN_SUPER_CONST, SLITHEEN_SUPER_CONST_SIZE,
@@ -1423,8 +1423,8 @@ void generate_client_super_keys(uint8_t *secret, client *c){
     mac_key = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, NULL, mac_secret, mac_len);
     EVP_DigestSignInit(mac_ctx, NULL, md, NULL, mac_key);
 
-    c->header_key = emalloc(key_len);
-    c->body_key = emalloc(key_len);
+    c->header_key = smalloc(key_len);
+    c->body_key = smalloc(key_len);
 
     memcpy(c->header_key, hdr_key, key_len);
     memcpy(c->body_key, bdy_key, key_len);
@@ -1532,7 +1532,7 @@ int super_encrypt(client *c, uint8_t *data, uint32_t len){
 #if OPENSSL_VERSION_NUMBER >= 0x1010000eL
     mac_ctx = EVP_MD_CTX_new();
 #else
-    mac_ctx = ecalloc(1, sizeof(EVP_MD_CTX));
+    mac_ctx = scalloc(1, sizeof(EVP_MD_CTX));
     EVP_MD_CTX_init(mac_ctx);
 #endif
 
@@ -1780,7 +1780,7 @@ int partial_aes_gcm_tls_cipher(flow *f, unsigned char *out,
         return -1;
 
     //set IV
-    uint8_t *iv = emalloc(f->gcm_ctx_ivlen);
+    uint8_t *iv = smalloc(f->gcm_ctx_ivlen);
     memcpy(iv, f->gcm_ctx_iv, EVP_GCM_TLS_FIXED_IV_LEN);
 
     if(enc){

+ 19 - 19
relay_station/flow.c

@@ -52,13 +52,13 @@ sem_t flow_table_lock;
 /* Initialize the table of tagged flows */
 int init_tables(void) {
 
-    table = emalloc(sizeof(flow_table));
+    table = smalloc(sizeof(flow_table));
     table->first_entry = NULL;
     table->len = 0;
 
     sem_init(&flow_table_lock, 0, 1);
 
-    clients = emalloc(sizeof(client_table));
+    clients = smalloc(sizeof(client_table));
     clients->first = NULL;
     printf("initialized downstream queue\n");
 
@@ -68,9 +68,9 @@ int init_tables(void) {
 
 /* Add a new flow to the tagged flow table */
 flow *add_flow(struct packet_info *info) {
-    flow_entry *entry = emalloc(sizeof(flow_entry));
+    flow_entry *entry = smalloc(sizeof(flow_entry));
 
-    flow *new_flow = emalloc(sizeof(flow));
+    flow *new_flow = smalloc(sizeof(flow));
 
     entry->f = new_flow;
     entry->next = NULL;
@@ -83,17 +83,17 @@ flow *add_flow(struct packet_info *info) {
     new_flow->ref_ctr = 1;
     new_flow->removed = 0;
 
-    new_flow->upstream_app_data = emalloc(sizeof(app_data_queue));
+    new_flow->upstream_app_data = smalloc(sizeof(app_data_queue));
     new_flow->upstream_app_data->first_packet = NULL;
-    new_flow->downstream_app_data = emalloc(sizeof(app_data_queue));
+    new_flow->downstream_app_data = smalloc(sizeof(app_data_queue));
     new_flow->downstream_app_data->first_packet = NULL;
 
     new_flow->upstream_seq_num = ntohl(info->tcp_hdr->sequence_num);
     new_flow->downstream_seq_num = ntohl(info->tcp_hdr->ack_num);
 
-    new_flow->us_frame_queue = emalloc(sizeof(frame_queue));
+    new_flow->us_frame_queue = smalloc(sizeof(frame_queue));
     new_flow->us_frame_queue->first_frame = NULL;
-    new_flow->ds_frame_queue = emalloc(sizeof(frame_queue));
+    new_flow->ds_frame_queue = smalloc(sizeof(frame_queue));
     new_flow->ds_frame_queue->first_frame = NULL;
 
     new_flow->streams=NULL;
@@ -113,13 +113,13 @@ flow *add_flow(struct packet_info *info) {
     new_flow->us_hs_queue = init_queue();
     new_flow->ds_hs_queue = init_queue();
 
-    new_flow->us_packet_chain = emalloc(sizeof(packet_chain));
+    new_flow->us_packet_chain = smalloc(sizeof(packet_chain));
     new_flow->us_packet_chain->expected_seq_num = ntohl(info->tcp_hdr->sequence_num);
     new_flow->us_packet_chain->record_len = 0;
     new_flow->us_packet_chain->remaining_record_len = 0;
     new_flow->us_packet_chain->first_packet = NULL;
 
-    new_flow->ds_packet_chain = emalloc(sizeof(packet_chain));
+    new_flow->ds_packet_chain = smalloc(sizeof(packet_chain));
     new_flow->ds_packet_chain->expected_seq_num = ntohl(info->tcp_hdr->ack_num);
     new_flow->ds_packet_chain->record_len = 0;
     new_flow->ds_packet_chain->remaining_record_len = 0;
@@ -783,7 +783,7 @@ flow *check_flow(struct packet_info *info){
 }
 
 int init_session_cache(void){
-    sessions = emalloc(sizeof(session_cache));
+    sessions = smalloc(sizeof(session_cache));
 
     sessions->length = 0;
     sessions->first_session = NULL;
@@ -908,7 +908,7 @@ int check_extensions(flow *f, uint8_t *hs, uint32_t len){
     p += 2; //skip version
     p += SSL3_RANDOM_SIZE; //skip random
 
-    session *new_session = emalloc(sizeof(session));
+    session *new_session = smalloc(sizeof(session));
     new_session->session_id_len = (uint8_t) p[0];
     new_session->session_ticket_len = 0;
     new_session->session_ticket = NULL;
@@ -958,7 +958,7 @@ int check_extensions(flow *f, uint8_t *hs, uint32_t len){
             if(ext_len > 0){
                 f->resume_session = 1;
                 new_session->session_ticket_len = ext_len;
-                new_session->session_ticket = ecalloc(1, ext_len);
+                new_session->session_ticket = scalloc(1, ext_len);
                 memcpy(new_session->session_ticket, p, ext_len);
                 f->current_session = new_session;
             }
@@ -1059,7 +1059,7 @@ int save_session_id(flow *f, uint8_t *hs){
     p += 2; //skip version
     p += SSL3_RANDOM_SIZE; //skip random
 
-    session *new_session = emalloc(sizeof(session));
+    session *new_session = smalloc(sizeof(session));
 
     new_session->session_id_len = (uint8_t) p[0];
     if((new_session->session_id_len <= 0) || (new_session->session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH)){
@@ -1137,7 +1137,7 @@ int save_session_ticket(flow *f, uint8_t *hs, uint32_t len){
 #endif
     uint8_t *p = hs + HANDSHAKE_HEADER_LEN;
     p += 4;
-    session *new_session = ecalloc(1, sizeof(session));
+    session *new_session = scalloc(1, sizeof(session));
 
     new_session->session_id_len = 0;
 
@@ -1145,7 +1145,7 @@ int save_session_ticket(flow *f, uint8_t *hs, uint32_t len){
     new_session->next = NULL;
     p += 2;
 
-    uint8_t *ticket = emalloc(new_session->session_ticket_len);
+    uint8_t *ticket = smalloc(new_session->session_ticket_len);
 
     memcpy(ticket, p, new_session->session_ticket_len);
     new_session->session_ticket = ticket;
@@ -1201,12 +1201,12 @@ int add_packet(flow *f, struct packet_info *info){
         return 0;
     }
 
-    packet *new_packet = emalloc(sizeof(packet));
+    packet *new_packet = smalloc(sizeof(packet));
 
     new_packet->seq_num = ntohl(info->tcp_hdr->sequence_num);
     new_packet->len = info->app_data_len;
 
-    uint8_t *packet_data = emalloc(new_packet->len);
+    uint8_t *packet_data = smalloc(new_packet->len);
     memcpy(packet_data, info->app_data, new_packet->len);
 
     new_packet->data = packet_data;
@@ -1262,7 +1262,7 @@ int add_packet(flow *f, struct packet_info *info){
         //if full record, give to update_flow
         if(chain->remaining_record_len <= new_packet->len){//we have enough to make a record
             chain->remaining_record_len = 0;
-            uint8_t *record = emalloc(chain->record_len);
+            uint8_t *record = smalloc(chain->record_len);
             uint32_t record_len = chain->record_len;
             uint32_t tmp_len = chain->record_len;
 

+ 1 - 1
relay_station/packet.c

@@ -91,7 +91,7 @@ void extract_packet_headers(uint8_t *packet, struct packet_info *info){
 /** Copies a packet_info structure and returns a pointer to the duplicate.
 */
 struct packet_info *copy_packet_info(struct packet_info *src_info){
-    struct packet_info *dst_info = emalloc(sizeof(struct packet_info));
+    struct packet_info *dst_info = smalloc(sizeof(struct packet_info));
 
     dst_info->ip_hdr = src_info->ip_hdr;
     dst_info->tcp_hdr = src_info->tcp_hdr;

+ 21 - 21
relay_station/relay.c

@@ -147,9 +147,9 @@ int read_header(flow *f, struct packet_info *info){
         //check to see whether the previous record has finished
         if(f->upstream_remaining > info->app_data_len){
             //ignore entire packet for now
-            queue_block *new_block = emalloc(sizeof(queue_block));
+            queue_block *new_block = smalloc(sizeof(queue_block));
 
-            uint8_t *block_data = emalloc(info->app_data_len);
+            uint8_t *block_data = smalloc(info->app_data_len);
             memcpy(block_data, p, info->app_data_len);
 
             new_block->len = info->app_data_len;
@@ -175,7 +175,7 @@ int read_header(flow *f, struct packet_info *info){
             //process what we have
             record_hdr = (struct record_header*) f->upstream_queue->data;
             record_length = RECORD_LEN(record_hdr);
-            record_ptr = emalloc(record_length+ RECORD_HEADER_LEN);
+            record_ptr = smalloc(record_length+ RECORD_HEADER_LEN);
 
             queue_block *current = f->upstream_queue;
             int32_t offset =0;
@@ -199,9 +199,9 @@ int read_header(flow *f, struct packet_info *info){
         if(record_length + RECORD_HEADER_LEN > info->app_data_len){
 
             //add info to upstream queue
-            queue_block *new_block = emalloc(sizeof(queue_block));
+            queue_block *new_block = smalloc(sizeof(queue_block));
 
-            uint8_t *block_data = emalloc(info->app_data_len);
+            uint8_t *block_data = smalloc(info->app_data_len);
 
             memcpy(block_data, p, info->app_data_len);
 
@@ -226,7 +226,7 @@ int read_header(flow *f, struct packet_info *info){
     }
 
     p+= RECORD_HEADER_LEN;
-    uint8_t *decrypted_data = emalloc(record_length);
+    uint8_t *decrypted_data = smalloc(record_length);
 
     memcpy(decrypted_data, p, record_length);
 
@@ -315,7 +315,7 @@ int read_header(flow *f, struct packet_info *info){
             decode_len = decode_len*3/4;
         }
 
-        upstream_data = emalloc(decode_len + 1);
+        upstream_data = smalloc(decode_len + 1);
 
         BIO *bio, *b64;
         bio = BIO_new_mem_buf(message, -1);
@@ -375,13 +375,13 @@ int read_header(flow *f, struct packet_info *info){
                 //create new client
 
                 printf("Creating a new client\n");
-                client *new_client = emalloc(sizeof(client));
+                client *new_client = smalloc(sizeof(client));
 
                 memcpy(new_client->slitheen_id, p, output_len);
-                new_client->streams = emalloc(sizeof(stream_table));
+                new_client->streams = smalloc(sizeof(stream_table));
 
                 new_client->streams->first = NULL;
-                new_client->downstream_queue = emalloc(sizeof(data_queue));
+                new_client->downstream_queue = smalloc(sizeof(data_queue));
                 sem_init(&(new_client->queue_lock), 0, 1);
 
                 new_client->downstream_queue->first_block = NULL;
@@ -469,11 +469,11 @@ int read_header(flow *f, struct packet_info *info){
                         free(record_ptr);
                     return 1;
                 }
-                uint8_t *initial_data = emalloc(stream_len);
+                uint8_t *initial_data = smalloc(stream_len);
                 memcpy(initial_data, p, stream_len);
 
                 struct proxy_thread_data *thread_data = 
-                    emalloc(sizeof(struct proxy_thread_data));
+                    smalloc(sizeof(struct proxy_thread_data));
                 thread_data->initial_data = initial_data;
                 thread_data->initial_len = stream_len;
                 thread_data->stream_id = stream_id;
@@ -487,7 +487,7 @@ int read_header(flow *f, struct packet_info *info){
                 pthread_detach(proxy_thread);
                 printf("Spawned thread for proxy\n");
                 //add stream to table
-                stream *new_stream = emalloc(sizeof(stream));
+                stream *new_stream = smalloc(sizeof(stream));
                 new_stream->stream_id = stream_id;
                 new_stream->pipefd = pipefd[1];
                 new_stream->next = NULL;
@@ -585,7 +585,7 @@ void *proxy_covert_site(void *data){
             domain_len = p[0];
             p++;
             data_len --;
-            uint8_t *domain_name = emalloc(domain_len+1);
+            uint8_t *domain_name = smalloc(domain_len+1);
             memcpy(domain_name, p, domain_len);
             domain_name[domain_len] = '\0';
             struct hostent *host;
@@ -647,7 +647,7 @@ void *proxy_covert_site(void *data){
         }
     }
 
-    uint8_t *buffer = emalloc(BUFSIZ);
+    uint8_t *buffer = smalloc(BUFSIZ);
     int32_t buffer_len = BUFSIZ;
     //now select on reading from the pipe and from the socket
     for(;;){
@@ -737,7 +737,7 @@ void *proxy_covert_site(void *data){
             int32_t bytes_read;
             bytes_read = recv(handle, buffer, buffer_len, 0);
             if(bytes_read > 0){
-                uint8_t *new_data = emalloc(bytes_read);
+                uint8_t *new_data = smalloc(bytes_read);
                 memcpy(new_data, buffer, bytes_read);
 #ifdef DEBUG_PROXY
                 printf("PROXY (id %d): read %d bytes from censored site\n",stream_id, bytes_read);
@@ -750,7 +750,7 @@ void *proxy_covert_site(void *data){
 #endif
 
                 //make a new queue block
-                queue_block *new_block = emalloc(sizeof(queue_block));
+                queue_block *new_block = smalloc(sizeof(queue_block));
                 new_block->len = bytes_read;
                 new_block->offset = 0;
                 new_block->data = new_data;
@@ -903,7 +903,7 @@ int process_downstream(flow *f, int32_t offset, struct packet_info *info){
                 printf("\n");
                 fflush(stdout);
 #endif
-                f->partial_record_header = emalloc(RECORD_HEADER_LEN);
+                f->partial_record_header = smalloc(RECORD_HEADER_LEN);
                 memcpy(f->partial_record_header, p, remaining_packet_len);
                 f->partial_record_header_len = remaining_packet_len;
                 remaining_packet_len -= remaining_packet_len;
@@ -947,8 +947,8 @@ int process_downstream(flow *f, int32_t offset, struct packet_info *info){
             if(record_len > remaining_packet_len){
                 partial = 1;
 
-                f->partial_record = emalloc(record_len);
-                f->partial_record_dec = emalloc(record_len);
+                f->partial_record = smalloc(record_len);
+                f->partial_record_dec = smalloc(record_len);
                 f->partial_record_total_len = record_len;
                 f->partial_record_len = remaining_packet_len;
                 partial_offset = 0;
@@ -1407,7 +1407,7 @@ int process_downstream(flow *f, int32_t offset, struct packet_info *info){
                 partial = 0;
             } else {
                 //compute tag just to clear out ctx
-                uint8_t *tag = emalloc(EVP_GCM_TLS_TAG_LEN);
+                uint8_t *tag = smalloc(EVP_GCM_TLS_TAG_LEN);
                 partial_aes_gcm_tls_tag(f, tag, EVP_GCM_TLS_TAG_LEN);
                 free(tag);
 

+ 5 - 5
relay_station/slitheen.c

@@ -174,7 +174,7 @@ void *sniff_packets(void *args){
 void got_packet(uint8_t *args, const struct pcap_pkthdr *header, const uint8_t *packet){
     struct inject_args *iargs = (struct inject_args *) args;
 
-    uint8_t *tmp_packet = emalloc(header->len);
+    uint8_t *tmp_packet = smalloc(header->len);
     memcpy(tmp_packet, packet, header->len);
 
     process_packet(iargs, header, tmp_packet);
@@ -187,7 +187,7 @@ void got_packet(uint8_t *args, const struct pcap_pkthdr *header, const uint8_t *
  */
 void process_packet(struct inject_args *iargs, const struct pcap_pkthdr *header, uint8_t *packet){
 
-    struct packet_info *info = emalloc(sizeof(struct packet_info));
+    struct packet_info *info = smalloc(sizeof(struct packet_info));
     extract_packet_headers(packet, info);
 
     //Ignore non-TCP packets (shouldn't actually get any)
@@ -270,7 +270,7 @@ void process_packet(struct inject_args *iargs, const struct pcap_pkthdr *header,
 
                 if(seq_num > expected_seq){
                     //Delay and process later
-                    frame *new_frame = ecalloc(1, sizeof(frame));
+                    frame *new_frame = scalloc(1, sizeof(frame));
                     new_frame->iargs = iargs;
                     new_frame->packet = packet;
                     new_frame->header = header;
@@ -366,9 +366,9 @@ void save_packet(flow *f, struct packet_info *info){
     uint32_t seq_num = htonl(info->tcp_hdr->sequence_num);
 
     //add new app block
-    packet *new_block = ecalloc(1, sizeof(packet));
+    packet *new_block = scalloc(1, sizeof(packet));
     new_block->seq_num = htonl(info->tcp_hdr->sequence_num);
-    new_block->data = ecalloc(1, info->app_data_len);
+    new_block->data = scalloc(1, info->app_data_len);
     memcpy(new_block->data, info->app_data, info->app_data_len);
     new_block->len = info->app_data_len;
     new_block->next = NULL;

+ 4 - 4
relay_station/util.c

@@ -37,7 +37,7 @@
 #include "util.h"
 
 //malloc macro that exits on error
-void *emalloc(size_t size){
+void *smalloc(size_t size){
     void *ptr = malloc(size);
     if (ptr == NULL){
         fprintf(stderr, "Memory failure. Exiting...\n");
@@ -48,7 +48,7 @@ void *emalloc(size_t size){
 }
 
 //calloc macro that exits on error
-void *ecalloc(size_t nmemb, size_t size){
+void *scalloc(size_t nmemb, size_t size){
     void *ptr = calloc(nmemb, size);
     if(ptr == NULL){
         fprintf(stderr, "Memory failure. Exiting...\n");
@@ -63,7 +63,7 @@ void *ecalloc(size_t nmemb, size_t size){
  */
 
 queue *init_queue(){
-    queue *new_queue = emalloc(sizeof(queue));
+    queue *new_queue = smalloc(sizeof(queue));
 
     new_queue->first = NULL;
     new_queue->last = NULL;
@@ -79,7 +79,7 @@ void enqueue(queue *list, void *data){
     if(data == NULL){
         return;
     }
-    element *new_elem = emalloc(sizeof(element));
+    element *new_elem = smalloc(sizeof(element));
     new_elem->data = data;
     new_elem->next = NULL;
 

+ 2 - 2
relay_station/util.h

@@ -35,8 +35,8 @@
 #include <stddef.h>
 #include <stdint.h>
 
-void *emalloc(size_t size);
-void *ecalloc(size_t nmemb, size_t size);
+void *smalloc(size_t size);
+void *scalloc(size_t nmemb, size_t size);
 
 //Standard queue data structure
 typedef struct element_st {