Multiple fixes to code
This commit is contained in:
parent
9a9c5ea1c3
commit
29a68c8f55
8 changed files with 157 additions and 134 deletions
|
@ -4,8 +4,7 @@
|
|||
int main()
|
||||
{
|
||||
char addrstr[100];
|
||||
bzero(addrstr,100);
|
||||
strcat(addrstr,"/ip4/192.168.1.1/tcp/8080/");
|
||||
strcpy(addrstr,"/ip4/192.168.1.1/tcp/8080/");
|
||||
printf("INITIAL: %s\n",addrstr);
|
||||
struct MultiAddress* a;
|
||||
a= multiaddress_new_from_string(addrstr);
|
||||
|
@ -14,7 +13,7 @@ int main()
|
|||
//Remember, Decapsulation happens from right to left, never in reverse!
|
||||
|
||||
printf("A STRING:%s\n",a->string);
|
||||
multiaddress_encapsulate(a,"/ip4/192.31.200.1/udp/3333/");
|
||||
multiaddress_encapsulate(a,"/ip4/192.131.200.111/udp/3333/");
|
||||
printf("A STRING ENCAPSULATED:%s\n",a->string);
|
||||
|
||||
multiaddress_decapsulate(a,"udp");
|
||||
|
@ -24,7 +23,7 @@ int main()
|
|||
printf("A STRING ENCAPSULATED TCP:%s\n",a->string);
|
||||
|
||||
struct MultiAddress* beta;
|
||||
beta=multiaddress_new_from_bytes(a->bytes,a->bsize);
|
||||
beta = multiaddress_new_from_bytes(a->bytes,a->bsize);
|
||||
printf("B STRING: %s\n",beta->string);
|
||||
|
||||
multiaddress_free(a);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue