additional notes
This commit is contained in:
parent
483957077e
commit
36f4f4e1b8
1 changed files with 23 additions and 8 deletions
29
testing.c
29
testing.c
|
@ -3,12 +3,27 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
char addrstr[100];
|
||||
bzero(addrstr,100);
|
||||
strcat(addrstr,"/ip4/192.168.1.1/tcp/8080/");
|
||||
printf("INITIAL: %s\n",addrstr);
|
||||
struct maddr a;
|
||||
a=new_maddr_fs("/ip4/192.168.1.1/");
|
||||
printf("s str:%s\n",a.string);
|
||||
//m_encapsulate("/tcp/8080");
|
||||
//m_decapsulate("tcp");
|
||||
//struct maddr b;
|
||||
//b=new_maddr_fb(a.bytes,sizeof(a.bytes));
|
||||
//printf("B STRING: %s\n",b.string);
|
||||
a=new_maddr_fs(addrstr);
|
||||
printf("TEST BYTES: %s\n",Var_To_Hex(a.bsize[0], a.bytes));
|
||||
|
||||
//Remember, Decapsulation happens from right to left, never in reverse!
|
||||
|
||||
printf("A STRING:%s\n",a.string);
|
||||
m_encapsulate(&a,"/ip4/192.31.200.1/udp/3333/");
|
||||
printf("A STRING ENCAPSULATED:%s\n",a.string);
|
||||
|
||||
m_decapsulate(&a,"udp");
|
||||
printf("A STRING DECAPSULATED UDP:%s\n",a.string);
|
||||
|
||||
m_encapsulate(&a,"/tcp/8080");
|
||||
printf("A STRING ENCAPSULATED TCP:%s\n",a.string);
|
||||
|
||||
struct maddr beta;
|
||||
beta=new_maddr_fb(a.bytes,a.bsize[0]);
|
||||
printf("B STRING: %s\n",beta.string);
|
||||
}
|
Loading…
Reference in a new issue