Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00030 #ifdef _OBSOLETED
00031
00032 #include "parse_hostport.h"
00033 #include <string.h>
00034 #include "../dprint.h"
00035 #include "../ut.h"
00036
00037 char* parse_hostport(char* buf, str* host, short int* port)
00038 {
00039 char *tmp;
00040 int err;
00041
00042 host->s=buf;
00043 for(tmp=buf;(*tmp)&&(*tmp!=':');tmp++);
00044 host->len=tmp-buf;
00045 if (*tmp==0) {
00046 *port=0;
00047 } else {
00048 *tmp=0;
00049 *port=str2s((unsigned char*)(tmp+1), strlen(tmp+1), &err);
00050 if (err ){
00051 LOG(L_INFO,
00052 "ERROR: hostport: trailing chars in port number: %s\n",
00053 tmp+1);
00054
00055 }
00056 }
00057
00058 return host->s;
00059 }
00060
00061 #endif