I got the source port No. in hexa decimal no from the for loop as show in the code.. The Source port is 01 bb in this case.. I want to show it as 443 i.e. decimal how to show that...
printf("\nSource Port Number: ");
a = packet[34];
b = packet[35];
char num[20];
int num3;
strcpy (num, a);
strcat (num, b);
printf("Hexadecimal string %s\n", num);
sscanf(num,"%x", &num3);
printf("Decimal number %d\n", num3);
34 and 35 no. packet show the source port no. I have seen it from wireshark...I am getting 01 bb as the answer but i want to get it in decimal...