MHEG5  18.9.0
MHEG5 Documentation
mh5cookies.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2010 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 /*---includes for this file--------------------------------------------------*/
26 #include <stdio.h>
27 #include <string.h>
28 #include <ctype.h>
29 
30 #include "mh5cookies.h"
31 #include "mh5memory.h"
32 #include "mh5base.h"
33 #include "mh5date.h"
34 
35 #include "techtype.h"
36 
37 /*---constant definitions for this file--------------------------------------*/
38 
39 #define MAX_COOKIES 32
40 #define MAX_STORE_SIZE 8192
41 #define MINUTE 60
42 #define HOUR 1200
43 #define SECONDS_IN_DAY (24 * HOUR)
44 
45 
46 /*---local typedef structs for this file-------------------------------------*/
47 
48 typedef struct cookiestore_s
49 {
59 
63 
64 /*---local (static) variable declarations for this file----------------------*/
65 static cookiestore_t *cookiejar = NULL;
66 static cookiestore_t *oldest_cookie = NULL;
67 
68 static U32BIT cookie_count = 0;
69 static U32BIT cookiejar_size = 0;
70 
71 /*---local function prototypes for this file---------------------------------*/
72 static void DeleteCookie(cookiestore_t *cookie);
73 
74 static U32BIT SkipWhitespace(void *data, U32BIT offset, U32BIT data_len);
75 
76 static MHEG5Bool ParseIdentity(cookiestore_t *cookie);
77 
78 static void PushCookie(cookiestore_t *new_cookie);
79 
80 static MHEG5Int FindChrInStr(MHEG5String source, MHEG5Int offset, char *search);
81 
82 static MHEG5Bool StrCmpChr(MHEG5String cmp_str, char *cmp_chrs);
83 
84 static U8BIT* AddHeader(U8BIT *header, cookiestore_t *cookie);
85 
86 static MHEG5Int ParseDate(MHEG5String date_string, MHEG5Int *date, MHEG5Int *time);
87 
88 static void SetMaxAge(MHEG5String duration_string, MHEG5Int *date, MHEG5Int *time);
89 
90 static MHEG5Bool GetDomainFromUrl(char *full_url, MHEG5String *domain_string);
91 static MHEG5Bool CookieEqual(MHEG5String *stored, MHEG5String *requested);
92 
93 /*---global function definitions---------------------------------------------*/
94 
102 void MHEG5CookieParse(void *data, U32BIT data_len, char *url)
103 {
104  MHEG5String data_handle;
105  cookiestore_t *new_cookie;
108  U32BIT offset = 0;
109  MHEG5Int pos;
110  MHEG5Bool quoted;
111 
112  assert(data);
113 
114  data_handle.data = data;
115  data_handle.len = data_len;
116 
117  if (data_len > 11 && memcmp(data_handle.data, "Set-Cookie:", 11) == 0)
118  {
119  offset = strlen("Set-Cookie:");
120  new_cookie = MHEG5getMem(sizeof(cookiestore_t));
121  if (new_cookie)
122  {
123  new_cookie->secure = MHEG5FALSE;
124  new_cookie->expire_date = 0;
125  new_cookie->expire_time = 0;
126  new_cookie->domain.data = NULL;
127  new_cookie->domain.len = 0;
128  new_cookie->name.len = 0;
129  new_cookie->name.data = NULL;
130  new_cookie->path.len = 0;
131  new_cookie->path.data = NULL;
132  }
133  while (new_cookie && offset < data_len)
134  {
135  quoted = MHEG5FALSE;
136  /*skip to the beginning of the name field*/
137  offset = SkipWhitespace(data, offset, data_len);
138  /*find the end of the name, by searching for the '='*/
139  pos = FindChrInStr(data_handle, offset, "=");
140  if (pos > 0)
141  {
142  name.len = pos - offset;
143  name.data = (MHEG5Byte *)data + offset;
144  /*set the position to after the '='*/
145  offset = pos + 1;
146  if (data_handle.data[offset] == '\"')
147  {
148  offset++;
149  quoted = MHEG5TRUE;
150  }
151 
152  pos = FindChrInStr(data_handle, offset, ";");
153  if (pos == -1)
154  {
155  pos = FindChrInStr(data_handle, offset, "\r\n");
156  }
157  if (quoted)
158  {
159  pos--;
160  }
161 
162  value.data = (MHEG5Byte *)data + offset;
163  if (pos > 0)
164  {
165  value.len = pos - offset;
166  if (quoted)
167  {
168  /*reset the position*/
169  pos++;
170  }
171  offset = pos + 1;
172  }
173  else
174  {
175  value.len = data_handle.len - offset;
176  offset = data_handle.len;
177  }
178 
179 
180  if (StrCmpChr(name, "path") == MHEG5TRUE || StrCmpChr(name, "Path") == MHEG5TRUE)
181  {
182  new_cookie->path = MHEG5stringCopy(value);
183  }
184  else if (StrCmpChr(name, "domain") == MHEG5TRUE)
185  {
186  new_cookie->domain = MHEG5stringCopy(value);
187  }
188  else if (StrCmpChr(name, "expires") == MHEG5TRUE)
189  {
190  ParseDate(value, &new_cookie->expire_date, &new_cookie->expire_time);
191  }
192  else if (StrCmpChr(name, "max-age") == MHEG5TRUE)
193  {
194  SetMaxAge(value, &new_cookie->expire_date, &new_cookie->expire_time);
195  }
196  else if (StrCmpChr(name, "Version") == MHEG5TRUE)
197  {
198  new_cookie->version = MHEG5strToInt(value);
199  }
200  else
201  {
202  new_cookie->value = MHEG5stringCopy(value);
203  new_cookie->name = MHEG5stringCopy(name);
204  }
205  }
206  }
207  if (new_cookie)
208  {
209  if (new_cookie->domain.len == 0)
210  {
211  GetDomainFromUrl(url, &new_cookie->domain);
212  }
213  new_cookie->identity.len = new_cookie->name.len + new_cookie->domain.len +
214  new_cookie->path.len + 1;
215  new_cookie->identity.data = STR_DataAlloc(new_cookie->identity.len);
216  if (new_cookie->identity.data)
217  {
218  offset = 0;
219  memcpy(new_cookie->identity.data + offset, new_cookie->name.data, new_cookie->name.len);
220  offset += new_cookie->name.len;
221 
222  *(new_cookie->identity.data + offset) = ',';
223  offset++;
224 
225  memcpy(new_cookie->identity.data + offset, new_cookie->domain.data, new_cookie->domain.len);
226  offset += new_cookie->domain.len;
227  memcpy(new_cookie->identity.data + offset, new_cookie->path.data, new_cookie->path.len);
228  PushCookie(new_cookie);
229  }
230  }
231  }
232 }
233 
244 {
245  U8BIT *cookie_header = NULL;
246  int offset;
248  cookiestore_t *cursor;
250  MHEG5String location;
251  S32BIT current_time, current_date;
252 
253  if (!cookiejar)
254  {
255  /*no cookies*/
256  return NULL;
257  }
258 
259  MHEG5getDate(&current_date, &current_time);
260  if (!memcmp(url, "http://", 7))
261  {
262  offset = 7;
263  secure = MHEG5FALSE;
264  }
265  else if (!memcmp(url, "https://", 8))
266  {
267  offset = 8;
268  secure = MHEG5TRUE;
269  }
270  else
271  {
272  /*The URL seems to be broke,
273  but we'll let somebody else deal with it*/
274  return NULL;
275  }
276 
277  location.len = strlen((char *)url) - offset;
278  location.data = url + offset;
279 
280  cursor = cookiejar;
281 
282  while (cursor)
283  {
284  next = cursor->next;
285  if (cursor->expire_date == 0 ||
286  cursor->expire_date > current_date ||
287  (cursor->expire_date == current_date && cursor->expire_time > current_time))
288  {
289  if ((cursor->secure == MHEG5FALSE || secure == MHEG5TRUE) &&
290  !memcmp(location.data, cursor->domain.data, cursor->domain.len))
291  {
292  offset = cursor->domain.len;
293  if (!memcmp(location.data + offset, cursor->path.data, cursor->path.len))
294  {
295  cookie_header = AddHeader(cookie_header, cursor);
296  }
297  }
298  }
299  /* else
300  {
301  DeleteCookie(cursor);
302  }*/
303 
304  cursor = next;
305  }
306 
307  return cookie_header;
308 }
309 
318 {
319  cookiestore_t *new_cookie;
320  MHEG5Bool success = MHEG5FALSE;
321 
322  if (cookie->value.len > MAX_STORE_SIZE)
323  {
324  return MHEG5FALSE;
325  }
326  new_cookie = MHEG5getMem(sizeof(cookiestore_t));
327  if (new_cookie)
328  {
329  new_cookie->identity = MHEG5stringCopy(cookie->identity);
330  success = ParseIdentity(new_cookie);
331  if (success == MHEG5TRUE)
332  {
333  new_cookie->value = MHEG5stringCopy(cookie->value);
334 
335  new_cookie->secure = cookie->secure;
336  new_cookie->expire_date = cookie->expires;
337  new_cookie->expire_time = 0;
338  PushCookie(new_cookie);
339  }
340  else
341  {
342  MHEG5freeMem(new_cookie);
343  }
344  }
345  return success;
346 }
347 
355 {
356  assert(header);
357  MHEG5freeMem(header);
358 }
359 
369 {
370  cookiestore_t *cursor;
372  S32BIT current_time, current_date;
373 
374  MHEG5getDate(&current_date, &current_time);
375  cursor = cookiejar;
376  while (cursor)
377  {
378  next = cursor->next;
379  /*if(cursor->expire_date == 0 ||
380  cursor->expire_date > current_date ||
381  (cursor->expire_date == current_date && cursor->expire_time > current_time)) */
382  {
383  if (CookieEqual(&cursor->identity, &cookie->identity) == MHEG5TRUE)
384  {
385  cookie->expires = cursor->expire_date;
386  cookie->secure = cursor->secure;
387  cookie->value = MHEG5stringCopy(cursor->value);
388  return MHEG5TRUE;
389  }
390  }
391  /* else
392  {
393  DeleteCookie(cursor);
394  }*/
395  cursor = next;
396  }
397 
398  return MHEG5FALSE;
399 }
400 
406 {
407  while (cookiejar)
408  {
409  DeleteCookie(cookiejar);
410  }
411 }
412 
421 static U32BIT SkipWhitespace(void *data, U32BIT offset, U32BIT data_len)
422 {
423  U8BIT *handle = data;
424 
425  while (offset < data_len)
426  {
427  if (handle[offset] != ' ' && handle[offset] != '\t' && handle[offset] != '\r' && handle[offset] != '\n')
428  {
429  return offset;
430  }
431  offset++;
432  }
433  return offset;
434 }
435 
443 static void DeleteCookie(cookiestore_t *cookie)
444 {
445  assert(cookie);
446 
447  if (cookie->name.data != cookie->identity.data)
448  {
449  if (cookie->name.len)
450  MHEG5stringDestruct(&cookie->name);
451  if (cookie->path.len)
452  MHEG5stringDestruct(&cookie->path);
453  if (cookie->domain.len)
454  MHEG5stringDestruct(&cookie->domain);
455  }
456 
457  if (cookie->value.len)
458  {
459  cookiejar_size -= cookie->value.len;
460  MHEG5stringDestruct(&cookie->value);
461  }
462  if (cookie->identity.len)
463  {
464  MHEG5stringDestruct(&cookie->identity);
465  }
466  if (cookie->previous)
467  {
468  cookie->previous->next = cookie->next;
469  }
470  else
471  {
472  assert(cookie == cookiejar);
473  cookiejar = cookie->next;
474  }
475 
476  if (cookie->next)
477  {
478  cookie->next->previous = cookie->previous;
479  }
480 
481  if (cookie == oldest_cookie)
482  {
483  oldest_cookie = cookie->previous;
484  }
485 
486  MHEG5freeMem(cookie);
487  cookie_count--;
488 }
489 
496 static MHEG5Bool ParseIdentity(cookiestore_t *cookie)
497 {
498  MHEG5Bool success = MHEG5FALSE;
499  MHEG5Int domain_pos, path_pos;
500  int offset;
501 
502  domain_pos = FindChrInStr(cookie->identity, 0, ",");
503  if (domain_pos != -1)
504  {
505  path_pos = FindChrInStr(cookie->identity, domain_pos, "/");
506  if (path_pos != -1)
507  {
508  cookie->name.len = domain_pos;
509  cookie->name.data = cookie->identity.data;
510 
511  cookie->domain.len = path_pos - domain_pos - 1;
512  offset = domain_pos + 1;
513  cookie->domain.data = cookie->identity.data + offset;
514 
515  cookie->path.len = cookie->identity.len - path_pos;
516  offset = path_pos;
517  cookie->path.data = cookie->identity.data + offset;
518 
519  success = MHEG5TRUE;
520  }
521  }
522 
523  return success;
524 }
525 
532 static void PushCookie(cookiestore_t *new_cookie)
533 {
534  if (cookiejar == NULL)
535  {
536  cookiejar = new_cookie;
537  new_cookie->previous = NULL;
538  new_cookie->next = NULL;
539  oldest_cookie = new_cookie;
540  }
541  else
542  {
543  cookiejar->previous = new_cookie;
544  new_cookie->next = cookiejar;
545  new_cookie->previous = NULL;
546  cookiejar = new_cookie;
547  }
548 
549 
550  cookie_count++;
551  cookiejar_size += new_cookie->value.len;
552 
553  if (cookie_count > MAX_COOKIES)
554  {
555  DeleteCookie(oldest_cookie);
556  }
557 
558  while (cookiejar_size > MAX_STORE_SIZE)
559  {
560  DeleteCookie(oldest_cookie);
561  }
562 }
563 
573 static MHEG5Int FindChrInStr(MHEG5String source, MHEG5Int offset, char *search)
574 {
575  int len;
576  register int rc = -1, i, j = 0;
577 
578  if (offset >= 0 && offset < source.len && search && source.data)
579  {
580  len = strlen(search);
581  for (i = offset; i != source.len; i++)
582  {
583  if ((source.data[i] | 0x20) == (search[j] | 0x20))
584  {
585  if (j == 0)
586  rc = i;
587  j++;
588  if (j == len)
589  {
590  return rc;
591  }
592  }
593  else
594  {
595  j = 0;
596  }
597  }
598  }
599  return -1;
600 }
601 
609 static MHEG5Bool StrCmpChr(MHEG5String cmp_str, char *cmp_chrs)
610 {
611  if (cmp_str.len != strlen(cmp_chrs))
612  {
613  return MHEG5FALSE;
614  }
615 
616  if (!memcmp(cmp_chrs, cmp_str.data, cmp_str.len))
617  {
618  return MHEG5TRUE;
619  }
620  else
621  {
622  return MHEG5FALSE;
623  }
624 }
625 
626 static U8BIT* AddHeader(U8BIT *header, cookiestore_t *cookie)
627 {
628  U8BIT *header_string;
629  int offset, len;
630 
631  if (!header)
632  {
633  header = MHEG5getMem(23);
634 
635  memcpy(header, "Cookie: $Version=\"0\"; \0", 23);
636  }
637 
638  len = strlen((char *)header);
639  len += cookie->name.len;
640  len += cookie->value.len;
641  len += cookie->path.len;
642  len += 12;
643  header_string = MHEG5getMem(len);
644 
645  memcpy(header_string, header, strlen((char *)header));
646  offset = strlen((char *)header);
647 
648  MHEG5freeMem(header);
649 
650  memcpy(header_string + offset, cookie->name.data, cookie->name.len);
651  offset += cookie->name.len;
652 
653  memcpy(header_string + offset, "=", 1);
654  offset += 1;
655 
656  memcpy(header_string + offset, cookie->value.data, cookie->value.len);
657  offset += cookie->value.len;
658 
659  memcpy(header_string + offset, "; $Path=", 8);
660  offset += 8;
661 
662  memcpy(header_string + offset, cookie->path.data, cookie->path.len);
663  offset += cookie->path.len;
664 
665  memcpy(header_string + offset, "; \0", 3);
666 
667 
668  return header_string;
669 }
670 
671 static S32BIT ParseMonthString(U8BIT *input_string)
672 {
673  S32BIT month_index = 0;
674  switch (input_string[0])
675  {
676  case 'J':
677  if (!memcmp(input_string, "Jan", 3))
678  {
679  month_index = 1;
680  }
681  if (!month_index && !memcmp(input_string, "Jun", 3))
682  {
683  month_index = 6;
684  }
685  if (!month_index && !memcmp(input_string, "Jul", 3))
686  {
687  month_index = 7;
688  }
689  break;
690  case 'F':
691  if (!memcmp(input_string, "Feb", 3))
692  {
693  month_index = 2;
694  }
695  break;
696  case 'M':
697  if (!memcmp(input_string, "Mar", 3))
698  {
699  month_index = 3;
700  }
701  if (!month_index && !memcmp(input_string, "May", 3))
702  {
703  month_index = 5;
704  }
705  break;
706  case 'A':
707  if (!memcmp(input_string, "Apr", 3))
708  {
709  month_index = 4;
710  }
711  if (!month_index && !memcmp(input_string, "Aug", 3))
712  {
713  month_index = 8;
714  }
715  break;
716  case 'S':
717  if (!memcmp(input_string, "Sep", 3))
718  {
719  month_index = 9;
720  }
721  break;
722  case 'O':
723  if (!memcmp(input_string, "Oct", 3))
724  {
725  month_index = 10;
726  }
727  break;
728  case 'N':
729  if (!memcmp(input_string, "Nov", 3))
730  {
731  month_index = 11;
732  }
733  break;
734  case 'D':
735  if (!memcmp(input_string, "Dec", 3))
736  {
737  month_index = 12;
738  }
739  break;
740  }
741 
742  return month_index;
743 }
744 
745 static S32BIT ParseTimeString(U8BIT *input_string)
746 {
747  S32BIT time;
748  time = (input_string[0] - '0') * HOUR * 10;
749  time += (input_string[1] - '0') * HOUR;
750  time += (input_string[3] - '0') * MINUTE * 10;
751  time += (input_string[4] - '0') * MINUTE;
752  time += (input_string[6] - '0') * 10;
753  time += (input_string[7] - '0');
754  return time;
755 }
756 
757 static MHEG5Int ParseDate(MHEG5String date_string, MHEG5Int *date, MHEG5Int *time)
758 {
759  S32BIT day = 0;
760  S32BIT month;
761  S32BIT year = 0;
762  if (date_string.len == 29)
763  {
764  day = (date_string.data[5] - '0') * 10;
765  day += date_string.data[6] - '0';
766  month = ParseMonthString(date_string.data + 8);
767  year = (date_string.data[12] - '0') * 1000;
768  year += (date_string.data[13] - '0') * 100;
769  year += (date_string.data[14] - '0') * 10;
770  year += date_string.data[15] - '0';
771  *date = JulianDate(day, month, year);
772  *time = ParseTimeString(date_string.data + 17);
773  }
774 
775  return 0;
776 }
777 
778 static void SetMaxAge(MHEG5String duration_string, MHEG5Int *date, MHEG5Int *time)
779 {
780  MHEG5Int max_age;
781  S32BIT current_date, current_time;
782 
783 
784  max_age = MHEG5strToInt(duration_string);
785  MHEG5getDate(&current_date, &current_time);
786 
787  *date = current_date + (max_age / SECONDS_IN_DAY);
788  *time = current_time + (max_age % SECONDS_IN_DAY);
789 }
790 
791 static MHEG5Bool GetDomainFromUrl(char *full_url, MHEG5String *domain_string)
792 {
793  U32BIT full_len;
794  U32BIT offset, end;
795  full_len = strlen(full_url);
796 
797  if (full_len > 7 && full_url[7] != '/')
798  {
799  offset = 7;
800  }
801  else if (full_len > 8 && full_url[8] != '/')
802  {
803  offset = 8;
804  }
805  else
806  {
807  return MHEG5FALSE;
808  }
809  for (end = offset; end != full_len; end++)
810  {
811  if (full_url[end] == '/')
812  {
813  break;
814  }
815  }
816  if (end == full_len)
817  {
818  return MHEG5FALSE;
819  }
820  end -= offset;
821  domain_string->data = STR_DataAlloc(end);
822  if (domain_string->data == NULL)
823  {
824  return MHEG5FALSE;
825  }
826  domain_string->len = end;
827  memcpy(domain_string->data,(U8BIT *)full_url + offset,end);
828  return MHEG5TRUE;
829 }
830 
840 static MHEG5Bool CookieEqual(MHEG5String *stored, MHEG5String *requested)
841 {
842  enum { NAME, DOMAIN, PATH } state = NAME;
843  MHEG5Int i, len;
844  MHEG5Bool equal;
845 
846  equal = MHEG5FALSE;
847  if (stored->len == requested->len)
848  {
849  equal = MHEG5TRUE;
850  len = stored->len;
851  for (i = 0; equal && i < len; i++)
852  {
853  if ((state == DOMAIN) && (stored->data[i] == '/'))
854  {
855  state = PATH;
856  }
857 
858  if (state == DOMAIN)
859  {
860  /* case-insensitive comparison */
861  if (toupper(stored->data[i]) != toupper(requested->data[i]))
862  {
863  equal = MHEG5FALSE;
864  }
865  }
866  else
867  {
868  if (stored->data[i] != requested->data[i])
869  {
870  equal = MHEG5FALSE;
871  }
872  }
873 
874  if ((state == NAME) && (stored->data[i] == ','))
875  {
876  state = DOMAIN;
877  }
878  }
879  }
880 
881  return equal;
882 }
883 
Date functions.
MHEG5String value
Definition: mh5cookies.h:41
Basis MHEG5 data types.
#define MAX_STORE_SIZE
Definition: mh5cookies.c:40
MHEG5Int expire_date
Definition: mh5cookies.c:56
const char * data
Definition: mh5gate.c:56
MHEG5String value
Definition: mh5cookies.c:52
unsigned char * STR_DataAlloc(unsigned int size)
Definition: glue_memory.c:596
MHEG5Int expire_time
Definition: mh5cookies.c:57
struct cookiestore_s * previous
Definition: mh5cookies.c:61
#define MHEG5getMem
Definition: glue_memory.h:93
void MHEG5getDate(S32BIT *day, S32BIT *sec)
Modified Julian Date - see Davic 9.2.12.1.
Definition: mh5date.c:111
U8BIT * MHEG5CookieGenerateHeader(U8BIT *url)
Generate a "Cookie" header for the required http request, containing all valid cookies.
Definition: mh5cookies.c:243
MHEG5String path
Definition: mh5cookies.c:53
MHEG5Int MHEG5strToInt(MHEG5String string)
Convert a MHEG5String to a MHEG5Integer.
Definition: mh5base.c:739
void MHEG5CookieClearStore(void)
Delete all cookies from the temporary store.
Definition: mh5cookies.c:405
void MHEG5CookieParse(void *data, U32BIT data_len, char *url)
Parse a Set-cookie header and add the new cookie to the store. If the header is not a set-cookie...
Definition: mh5cookies.c:102
MHEG5String MHEG5stringCopy(MHEG5String source)
<Function description>="">
Definition: mh5base.c:574
void MHEG5stringDestruct(MHEG5String *item)
Destruct a MHEG5String.
Definition: mh5base.c:686
uint8_t U8BIT
Definition: techtype.h:82
long MHEG5Int
Definition: mh5base.h:73
MHEG5Int version
Definition: mh5cookies.c:55
MHEG5Bool secure
Definition: mh5cookies.h:43
#define MHEG5freeMem
Definition: glue_memory.h:94
MHEG5Bool MHEG5CookieRetrieve(MHEG5cookie_t *cookie)
Retrieve a specific cookie from the store, referenced by the identity string.
Definition: mh5cookies.c:368
short MHEG5Bool
Definition: mh5base.h:71
MHEG5Int expires
Definition: mh5cookies.h:42
unsigned char MHEG5Byte
Definition: mh5base.h:74
MHEG5String domain
Definition: mh5cookies.c:54
MHEG5Byte * data
Definition: mh5base.h:85
int len
Definition: mh5gate.c:57
struct cookiestore_s cookiestore_t
MHEG5Bool MHEG5CookieAdd(MHEG5cookie_t *cookie)
Directly add a cookie to the store.
Definition: mh5cookies.c:317
int32_t S32BIT
Definition: techtype.h:87
#define MHEG5TRUE
Definition: mh5base.h:49
MHEG5String name
Definition: mh5cookies.c:51
System Wide Global Technical Data Type Definitions.
MHEG5String identity
Definition: mh5cookies.h:40
struct cookiestore_s * next
Definition: mh5cookies.c:60
redirection include
Functions relating to HTTP Cookie Store.
U32BIT JulianDate(S32BIT day, S32BIT month, S32BIT year)
The function JulianDate() calculates the julian day number for the specified day, month and year...
Definition: mh5date.c:62
MHEG5Int len
Definition: mh5base.h:84
#define MAX_COOKIES
Definition: mh5cookies.c:39
MHEG5Bool secure
Definition: mh5cookies.c:58
#define SECONDS_IN_DAY
Definition: mh5cookies.c:43
#define MINUTE
Definition: mh5cookies.c:41
#define NAME
Definition: vpa1_tgs.h:113
#define HOUR
Definition: mh5cookies.c:42
void MHEG5CookieAckHeader(U8BIT *header)
This function should be called once the header string returned by MHEG5CookieGenerateHeader has been ...
Definition: mh5cookies.c:354
#define MHEG5FALSE
Definition: mh5base.h:48
uint32_t U32BIT
Definition: techtype.h:86
MHEG5String identity
Definition: mh5cookies.c:50