| 216 | | sscanf(cParam1,"%x:%x:%x:%x:%x:%x:%x:%x",&h1,&h2,&h3,&h4,&h5,&h6,&h7,&h8); |
| | 217 | |
| | 218 | //This is not going to work for all cases. |
| | 219 | //if cParam1 has no consecutive colons |
| | 220 | if(!(cp=strstr(cParam1,"::"))) |
| | 221 | { |
| | 222 | sscanf(cParam1,"%x:%x:%x:%x:%x:%x:%x:%x",&h1,&h2,&h3,&h4,&h5,&h6,&h7,&h8); |
| | 223 | } |
| | 224 | else |
| | 225 | { |
| | 226 | unsigned uPos=0; |
| | 227 | |
| | 228 | if(strstr(cp+2,"::")) |
| | 229 | { |
| | 230 | guMode=uMode; |
| | 231 | tResource("IPv6 number can not have more than one double colons."); |
| | 232 | } |
| | 233 | |
| | 234 | uPos=sscanf(cParam1,"%x:%x:%x:%x:%x:%x:%x:%x",&h1,&h2,&h3,&h4,&h5,&h6,&h7,&h8); |
| | 235 | //All first position cases, i.e. 2,3,4,5 and 6 word cases |
| | 236 | if(uPos==1) |
| | 237 | { |
| | 238 | uPos=sscanf(cParam1,"%x::%x:%x:%x:%x:%x:%x",&h1, &h3,&h4,&h5,&h6,&h7,&h8); |
| | 239 | if(uPos==2) |
| | 240 | uPos=sscanf(cParam1,"%x:%x::%x:%x:%x:%x:%x",&h1,&h2, &h4,&h5,&h6,&h7,&h8); |
| | 241 | } |
| | 242 | |
| | 243 | } |