Click HereClick Here
home features news forums classifieds faqs links search
5152 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Channel: #Amigaworld
Channel Policy and Guidelines

(Uses JAVA Applet and Port 1024)
Visit the Chatroom Website

Who's Online
 33 guest(s) on-line.
 2 member(s) on-line.


 NutsAboutAmiga,  scabit

You are an anonymous user.
Register Now!
 scabit:  43 secs ago
 NutsAboutAmiga:  3 mins ago
 Hypex:  7 mins ago
 Rob:  7 mins ago
 Epsilon:  9 mins ago
 terminills:  11 mins ago
 tlosm:  13 mins ago
 imagodespira:  13 mins ago
 thomas:  14 mins ago
 Wanderer:  19 mins ago

/  Forum Index
   /  General Technology (No Console Threads)
      /  IPv6
Register To Post

Goto page ( Previous Page 1 | 2 )
PosterThread
NutsAboutAmiga 
Re: IPv6
Posted on 15-Jun-2012 20:26:26
#21 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@olsen

Hi, I'm getting an error 3 what am I doing wrong?



#include <exec/errors.h>
#include <exec/emulation.h>

#include <stdlib.h>
#include <stdio.h>
#include <proto/exec.h>
#include <proto/dos.h>

#include <devices/sana2.h>


ULONG copy_to_buff_ppc(struct Hook *hook,struct IOSana2Req *sana2req,struct SANA2HookMsg *sana2hookmsg)
{
return 1;
};


static LONG copy_to_buff_68k(void)
{
ULONG *regs;
uint32 packet_len;
uint8 *to, *from;

regs = (ULONG *)(((struct ExecBase *)SysBase)->EmuWS);

packet_len = regs[REG68K_D0/ 4];
to = (uint8 *) regs[REG68K_A0/ 4];
from = (uint8 *) regs[REG68K_A1/ 4];

printf("old copy_to_buff_68k(void)\n");


return 1;
}

static LONG copy_from_buff_68k(void)
{
ULONG *regs;
uint32 packet_len;
uint8 *to;
uint8 *wds;

regs = (ULONG *)(((struct ExecBase *)SysBase)->EmuWS);

packet_len = regs[REG68K_D0/ 4];
to = (uint8 *) regs[REG68K_A0/ 4];
wds = (uint8 *) regs[REG68K_A1/ 4];

printf("old copy_from_buff_68k(void)\n");

return 1;
}


static CONST ULONG buffer_tags[] =
{
S2_CopyToBuff, (uint32)©_to_buff_68k,
S2_CopyFromBuff, (uint32)©_from_buff_68k,
TAG_END
};

int main()
{
ULONG hook_tags[] = {
S2_CopyToBuff, (ULONG) copy_to_buff_ppc,
TAG_END
};

char *dev_name = "eth3com.device";
int dev_unit = 0;
int od_error = 1; // not open error
struct MsgPort *write_port = NULL, *control_port = NULL;
struct IOSana2Req *write_io = NULL, *control_io = NULL;
struct Sana2Hook *sana2_hook;

int quit = 0;
int sigs = SIGBREAKF_CTRL_C;
int rsigs;

sana2_hook = AllocVec(sizeof(struct Sana2Hook),MEMF_SHARED | MEMF_CLEAR);

control_port = CreateMsgPort();

// Create control IORequest
if (control_io = (struct IOSana2Req *)CreateIORequest(control_port, sizeof(struct IOSana2Req)))
{
control_io->ios2_BufferManagement = (void *)&buffer_tags;
od_error = OpenDevice(dev_name, dev_unit, (struct IORequest *)control_io, 0);
}

if (!od_error)
{
control_io->ios2_Req.io_Command = S2_SANA2HOOK;
control_io->ios2_DataLength = sizeof(struct Sana2Hook);

sana2_hook -> s2h_Methods = hook_tags;


control_io->ios2_Data = sana2_hook;
printf("hook errror? %d\n",DoIO((struct IORequest *)control_io));

printf("device is open do some thing!!\n");
printf("press CTRL+C to quit\n");

while( !quit )
{
rsigs = Wait( sigs );

if (rsigs & SIGBREAKF_CTRL_C) quit = 1;
}

CloseDevice((struct IORequest *)control_io);
}

if (control_io)
{
DeleteIORequest( (struct IORequest*) control_io);
}

if (control_port)
{
DeleteMsgPort(control_port);
}

}

Last edited by _Steve_ on 16-Jun-2012 at 04:05 PM.
Last edited by NutsAboutAmiga on 15-Jun-2012 at 08:27 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
olsen 
Re: IPv6
Posted on 18-Jun-2012 8:34:10
#22 ]
Cult Member
Joined: 15-Aug-2004
Posts: 569
From: Germany

@NutsAboutAmiga

Quote:

NutsAboutAmiga wrote:
@olsen

Hi, I'm getting an error 3 what am I doing wrong?


Um, this needs a lot of work...

First thing, if you are opening a network device driver, you ought to set the station address of the device. For an Ethernet device, the station address is the transport layer address which the driver listens to when it receives data, and which is also used for mapping IPv4 addresses to Ethernet hardware addresses.

The station address needs to be set up once, the first time a network device is opened. It's safe to set it again, in which case the driver will ignore it, and all devices are supposed to support the command, even if they don't actually have a station address to set.

Here's how it works, in a nutshell:


struct IOSana2Req * s2req;
int error;

// Get the hardware default address
s2req->ios2_Req.io_Command = S2_GETSTATIONADDRESS;
DoIO((struct IORequest *)s2req);

// Use the default address as the station address
memcpy(s2req->ios2_SrcAddr,s2req->ios2_DstAddr,sizeof(s2req->ios2_DstAddr));

s2req->ios2_Req.io_Command = S2_CONFIGINTERFACE;
s2req->ios2_WireError = 0;

error = DoIO((struct IORequest *)s2req);
if(error != 0)
{
// Check if this is something serious, or if the address
// is already configured (not an error)
if(s2req->ios2_WireError != 0 && s2req->ios2_WireError != S2WERR_IS_CONFIGURED)
printf("something's up: %d, %d\n",error,s2req->ios2_WireError);
}


Next thing, you might want to rewrite the copy functions. From how they look, they are written in plain PPC code. This means that the Ethernet device driver will pass the parameters to them like any standard PPC function, and that the 68k emulator operations are not just unnecessary, but will likely fail to produce anything.

You'll need the 68k emulator only if you are expecting the device driver to be written in 68k code itself.

Anyway, your copy_to_buff function should use the following prototype:


LONG s2_copy_to_buff(APTR to_buffer,const UBYTE * from,ULONG len);


And the corresponding copy_from_buff should look something like this:


LONG s2_copy_from_buff(UBYTE * to,const APTR from_buffer,ULONG len);


Note that the to_buffer/from_buffer parameters will contain pointers to the buffer management data structures you are using, and not an APTR (which I just picked for the sake of the example).

I hope that this is helpful for the next steps you'll be taking

Incidentally, the numeric error codes you saw match the definitions in "devices/sana2.h", and you should look up what they say. The number 3 stands for "S2ERR_BAD_ARGUMENT" which in the header file is annotated as meaning "garbage somewhere". To get a more specific explanation of what is meant by this general error, have another look at the Sana2Req->ios2_WireError field which provides for more detailed information on the error. For example, the wire error field could be "S2WERR_NOT_CONFIGURED", meaning that the device driver refuses to perform your read/write request because the S2_CONFIGINTERFACE command was never used.

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 18-Jun-2012 16:03:50
#23 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@olsen

Thanks, I see if get stuff working when I get home.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 19-Jun-2012 21:58:30
#24 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@Dirk-B

I think conversion of IPv6 to IPv4 is possible, while its true you have more IP’s in IPv6 then IPv4, it’s not true that you are going to access all IP’s of IPv6 in a day, so what I’m saying is that IPv6 can temporary be assigned to a local IPv4 addresses for a day, all you need virtual DNS and gateway take care of the virtualization.

1. Local PC asks Virtual DNS server for IP of name ‘blabla’
2. Virtual DNS server ask Real DNS server for IPv6,
3. IPv6 IP stored in routing table, a virtual ip 11.0.0.1 is assigned to IPv6, (etch time virtual address is incremented 11.0.0.2 is next to be assigned)
4. virtual DNS returns virtual IPv4 address to local pc.

5. Local PC connects to 11.0.0.1 over the virtual router,
6. virtual router convert IPv4 into IPv6 using the routing table.

If 11.0.0.1 is not used for 12 hour is the virtual DNS entry and Virtual Route entry is dropped.

This way might be able to use 11.0.0.0/8 for virtualization, that’s 16777216 addresses that can assigned and re assigned over and over again, while your computer might not have the capacity to store so many virtual entries that not needed anyway because you only need to have number IP’s you accessed in maybe last hour .

It’s like whit ARP table it normally no more than 4 or 5 entries as list is often flushed.

There are probably a few security analysts that jump on me now if they read what I have suggested, they most likely hate it, because it makes all internet addresses anonymous, just looking IP’s will totally useless as identification, it also makes it hard to block IP addresses in programs, but that’s the job of a firewall not the program right?

Last edited by NutsAboutAmiga on 20-Jun-2012 at 03:57 PM.
Last edited by NutsAboutAmiga on 19-Jun-2012 at 10:58 PM.
Last edited by NutsAboutAmiga on 19-Jun-2012 at 10:00 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
Dirk-B 
Re: IPv6
Posted on 19-Jun-2012 23:24:18
#25 ]
Super Member
Joined: 8-Mar-2003
Posts: 1077
From: Belgium

@NutsAboutAmiga and all

Thanks for the explanation.


_________________
A1G3-SE + OS4.1 u1 iso (x2)

 Status: Offline
Profile     Report this post  
Seer 
Re: IPv6
Posted on 20-Jun-2012 11:47:04
#26 ]
Team Member
Joined: 27-Jun-2003
Posts: 3702
From: The Netherlands

@NutsAboutAmiga

AFAIK, IP6 is not simply a bigger ip adress. The packets send/received are different as well for instance. Sending a IP6 packet to an IP4 adress would need some conversions as well if even possible.

_________________
~
Everything you say will be misquoted and used against you..
~

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 20-Jun-2012 13:46:05
#27 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@Seer

Well yes… you need two way handshake, and you need to repackage etch package content, recalculate the CRC etc.

Last edited by NutsAboutAmiga on 20-Jun-2012 at 01:46 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
Seer 
Re: IPv6
Posted on 20-Jun-2012 14:33:48
#28 ]
Team Member
Joined: 27-Jun-2003
Posts: 3702
From: The Netherlands

@NutsAboutAmiga

Somehow I still don't think it's feasable to do. If it was easy, then I would think the adoption of IP6 would have happened several years ago.

Just that for instance an IP4 header is more complex then IP6 and you would need to build a new header for the packet in a way that IP4 accepts it (note that the header in ip6 should be bigger then ip4), plus you would need to send at least 2 ipv4 packets for every 1 IP6 packet (I think). I'm also not sure how you would handle the bigger payloads then IP4 would allow.

Also, you talk about dns, but I'm uncertain how you could get an IP6 dns if the stack only has an ip4 able dns?

Wouldn't the time spend on this be better used to create a new network stack? (Not to put you off, I know programmers dont like these questions (the "is it not better to spend time on" part)

Last edited by Seer on 20-Jun-2012 at 02:34 PM.

_________________
~
Everything you say will be misquoted and used against you..
~

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 20-Jun-2012 15:24:21
#29 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@Seer

Probably, but let’s say you have more the one computer in your house that does not support IPv6.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
jkirk 
Re: IPv6
Posted on 20-Jun-2012 16:43:39
#30 ]
Elite Member
Joined: 28-Jan-2005
Posts: 3311
From: Georgia (usa)

@Seer

tho working with an existing stack makes learning the basics a bit easier even if it is better to start over.

Last edited by jkirk on 20-Jun-2012 at 04:44 PM.

_________________
Win•dows: n. A thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition.

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 20-Jun-2012 20:00:21
#31 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@jkirk

I won’t promise anything it’s just an experiment, a jigsaw puzzle whit many components.

I hope to be able implement stuff in stages, unlike roadshow / sana2, Infinity stack will be divided in to many separate libraries; this means that parts can be taken out and replaced or improved.

You won’t need to stack up bunch of CMD_READ request to the devices, like whit sana2.

For now I think concentrate on getting network working in Basilisk whit the sana2 implementation.

Infinity will get sana2 gateway driver, it will work as translation layer between two different api’s.

I have no intention of coping existing API, this will be clean start, it also means that no existing application will be able to use Infinity for a long time to come.
While I might be able to produce an ARP.library from my ARP plugin tomorrow it’s of no or little use to anyone besides someone like me who is working on creating a new network stack, (yeh network stack, not tcp/ip stack)
Note there are many parts that have to work.

IPv4 (implemented)
IPv6 (started on, untested)
NDP (Network discovery protocol, think it is used by IPv6, not implemented, don’t think we need it, to speak IPv6)
TCP (partly implemented, problems whit handshake, MacOS knows about me but thinks the connection is lost)
ICMP (implemented, and working, ping protocol)
UDP (implemented, a simple protocol, that does not care for package loss)
ARP (implemented)
DHCP client (not implemented)
IPX/SPX (optimal, not implemented)
PPP (not implemented, used serial or cable modems, don’t think we need that)

The current implantation also has

“Like layer” a low level layer for distributing packages based on their mac address, it unclear at the moment if all traffic should go into this API, or if some packages should be allowed to go from device to device, to avoid overhead.

“connections” layer to keep track of sequence numbers, handshaking, in and out going port numbers.

“routing api” a api used when sender don’t know where to send traffic, currently its not implemented, instead when conection is created a ARP request will be sent to get mac address, if its not found then the connection failed.

“socket api” upper layer needs lots of work!!

“common api” standard api for plugin interface, checksums.

Last edited by NutsAboutAmiga on 21-Jun-2012 at 05:04 PM.
Last edited by NutsAboutAmiga on 20-Jun-2012 at 08:51 PM.
Last edited by NutsAboutAmiga on 20-Jun-2012 at 08:07 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
olsen 
Re: IPv6
Posted on 21-Jun-2012 14:41:43
#32 ]
Cult Member
Joined: 15-Aug-2004
Posts: 569
From: Germany

@NutsAboutAmiga

One word of advice: if you are going to break down your design into components which would be implemented as shared libraries, you'll want to make sure that the library names all begin with a common prefix. Here's why: the Amiga library "name space" is flat, and no authority exists which watches over it, preventing name space collisions.

So, for example, instead of using "arp.library" for the ARP specific portions of your design, you might want to use "jigsaw-arp.library" instead (if you want to call your TCP/IP stack "jigsaw", that is).

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 22-Jun-2012 14:10:37
#33 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@NutsAboutAmiga

Quote:
For now I think I concentrate on getting network working in Basilisk whit the sana2 implementation.


http://www.os4depot.net/index.php?function=uploads

uploaded all my changes to basilisk II.
(I think, replace the binary file when exit code is fixed.)

Last edited by NutsAboutAmiga on 22-Jun-2012 at 02:13 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
NutsAboutAmiga 
Re: IPv6
Posted on 22-Jun-2012 14:11:44
#34 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8599
From: Norway

@olsen

yes I was will, put prefix on all libraries I create.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Online!
Profile     Report this post  
Goto page ( Previous Page 1 | 2 )

[ home ][ about us ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright © 2000 - 2011 Amigaworld.net.

Page took 0.164073 seconds to load.