redirect.c

Go to the documentation of this file.
00001 
00024 #include <stdlib.h>
00025 #include<stdio.h>
00026 #include <string.h>
00027 
00028 #include "../mbms-rel6-flute-repair/helpers.h"
00029 
00030 #include "../../flutelib/getdnsname.h"
00031 
00039 int main(void) {
00040 
00041   char *hostname = NULL;
00042   
00043   char *repair_conf_file = NULL;
00044   repair_arguments_t ra;
00045   int retval;
00046   
00047   repair_conf_file = getenv("RepairConfFile");
00048 
00049   if(repair_conf_file == NULL) {
00050     return -1;
00051   }
00052 
00053   if(repair_conf_file[strlen(repair_conf_file)-1] == '\r') {
00054     repair_conf_file[strlen(repair_conf_file)-1] = '\0';
00055   }
00056   
00057   retval = parse_repair_conf_file(repair_conf_file, &ra);
00058     
00059   if(retval == -1) {
00060     return -1;
00061   }
00062 
00063   hostname = getdnsname();
00064 
00065   printf("%s%s%s%s%c%c", "Location: http://", hostname, "/", ra.ptm_repair_sdp_file, 13, 10);
00066   printf("%s%c%c", "Connection: close", 13, 10);
00067   printf("%c%c", 13, 10);
00068 
00069   free(hostname);
00070   return 0;
00071 }

Generated on Fri Mar 9 20:08:51 2007 for MAD-FCL by  doxygen 1.5.0