any sample code to extract these code with strtok() ?
What have you tried? strtok() only takes two arguments - the string to parse and an array of delimiters. You only have two delimiters - the colon and the NULL, and the NULL is implied.
char *token1 = strtok(buf, ":");
if(token1)
{
char *token2 = strtok(NULL, ":");
if(token2)
{
char *token3 = strtok(NULL, ":");
if(token3)
{
// Got all the tokens...
}
}
}