Re: [libdnet-devel] Opening a tunnel
Status: Abandoned
Brought to you by:
dugsong
|
From: Jesse P. <jes...@gm...> - 2009-06-02 21:07:35
|
Ok, so I'm having issues getting a tunnel handle. Probably the same
issue when trying to get the firewall handle. Any case this is the
test code I'm using. The comments are the lines I would use for
sending the information.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dnet.h>
int main(int argc, char** argv) {
struct addr *remotehost = malloc(sizeof(struct addr));
struct addr *localhost = malloc(sizeof(struct addr));
addr_aton(argv[1], remotehost);
addr_aton(argv[2], localhost);
tun_t *tunnel = tun_open(localhost, remotehost, 20);
if(tunnel == NULL) {
fprintf(stderr, "Could not get tunnel connection\n");
exit(34);
}
int size = 6*sizeof(char);
char *msg = malloc(size);
//char *msg = "hello";
ssize_t sentBytes = tun_recv(tunnel, msg, size);
//ssize_t sentBytes = tun_send(tunnel, msg, size);
printf("%s\n");
tun_close(tunnel);
return 0;
}
On Mon, Jun 1, 2009 at 11:54 PM, Heiko Westermann <he...@or...> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Jesse,
>
>> I'd like to try creating a simple tunnel with the library, or at least
>> know how I would.
>>
>> The general idea seems simple enough: Open the tunnel on both ends,
>> send, receive.
>>
>> tun_open is an issue because it takes an mtu int, and I can't find
>> documentation on what this is.
> the MTU is the max size of a packet.
> http://en.wikipedia.org/wiki/Maximum_transmission_unit
>>
>> I assume that a tunnel is connected by opening the interface with each
>> other's IP.
>>
>> When you are sending/receiving is a "packet" defined to be the size of
>> what you request?
>> FYI, I am trying to put this information to good use.
>> http://csfacwiki.cslabs.ewu.edu/wiki/securitylab/index.php/Libdnet
> No clue. Never used the tunnel feature. But you could look into the
> sourcecode. In most cases this solves your questions.
>
> regards,
> Heiko
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkokzKIACgkQ6tEFoe4a4XhGrACg5bqoesz9wzL6zjwsPzCHtvf3
> LOgAoNue1EpZijB+89UPSXRYwXv1AcUI
> =qn6U
> -----END PGP SIGNATURE-----
>
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> libdnet-devel mailing list
> lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libdnet-devel
>
|