Page 1 of 1

dns.irx argument

Posted: Sat Jan 17, 2009 2:41 pm
by LionX
i know ps2hdd.irx argument is like this: static char hddarg[] = "-o" "\0" "4" "\0" "-n" "\0" "20";



whats the orgument format for dns.irx ?


looks to me like its different

Posted: Sat Jan 17, 2009 9:47 pm
by ragnarok2040
Looking at the source, it looks like it takes only one arg, a nameserver IP as a string, so static char dnsarg[] = "xxx.xxx.xxx.xxx" "\0"; should work.

Posted: Sun Jan 18, 2009 5:41 pm
by LionX
HEHE, you think i hant tried that. thats just like the argument for the ps2hdd.irx or ps2fs.irx.

when the argument is ok for dns.irx it will print out this from _main(): "DNS: Setting nameserver IP to: 10.0.1.1"

the argument style you gave me didnt print anything form dns.irx's _main(). so its wrong.

after testing for hours i came up with this because i dont want to modify dns.c unless it needed to be fixed.

this is what works: static char dnsarg[] = "64.71.255." "198";

That looks stupid to me. who writes argument like that. thats why im asking.


im not a nuby. i just didnt want to research on how SifLoad...EE...IOP..MODULE.. handles arguments.

Posted: Sun Jan 18, 2009 7:18 pm
by dlanor
ragnarok2040 wrote:Looking at the source, it looks like it takes only one arg, a nameserver IP as a string, so static char dnsarg[] = "xxx.xxx.xxx.xxx" "\0"; should work.
Is there any particular reason why you specify a string terminating NUL character in the second quote section ?

It seems more natural to me to simply use:

static char dnsarg[] = "xxx.xxx.xxx.xxx";

and as far as I'm aware this should produce exactly the same string content, including the terminating NUL.
(Or did you want two terminators for some reason ?)

LionX wrote:HEHE, you think i hant tried that. thats just like the argument for the ps2hdd.irx or ps2fs.irx.

when the argument is ok for dns.irx it will print out this from _main(): "DNS: Setting nameserver IP to: 10.0.1.1"

the argument style you gave me didnt print anything form dns.irx's _main(). so its wrong.

after testing for hours i came up with this because i dont want to modify dns.c unless it needed to be fixed.

this is what works: static char dnsarg[] = "64.71.255." "198";

That looks stupid to me. who writes argument like that. thats why im asking.
To myself this is not a question of how to write an argument, but how you write a normal string assignment.

I just don't understand your need to split a perfectly normal string like that into two parts. I'd use the normal (to me anyway) construction:

static char dnsarg[] = "64.71.255.198";

And that should produce exactly the same string content in memory as your split string would do. Any additional parsing of this as an argument can not occur at this stage, but will only happen when you pass that string in a real function call.

And when that happens, regardless of whether you used my way of writing the string or your own way of writing it as two strings concatenated, the memory content of the passed argument string will be identical, and will match the generic IP form that ragnarok2040 recommended that you use. (Though he too used an odd split way of writing the string.)

Possibly I'm missing something here, but to me it appears that you are both splitting strings for no reason and confusing the issue by doing so.

Best regards: dlanor

Posted: Sun Jan 18, 2009 7:33 pm
by LionX
dlanor, you are right. i just tried static char dnsarg[] = "64.71.255.198";
and it worked.

what the heck, i thaught i tried that already. im must been compliling the wrong part of my project while i was debuging.

i also thught you need pass 2 argument to the dns.irx because in the _main() it says argcount==2;

i didnt know that the c:\yadadyad\dns.irx was one of the argument create by SifLoad...........


thanks.

Posted: Sun Jan 18, 2009 7:43 pm
by LionX
one more Question: im under widows XP and when i check my network connection iformation it says that my dns server is "10.0.1.1" which is the same as my gateway.

so i tried to set dns.irx to the same "10.0.1.1" and it return an error == -2 == DNS_ERROR_CONNECT witch means error connecting to dns server.


does this mean i got to use: "64.71.255.198"

what if that server goes down ?

Posted: Sun Jan 18, 2009 8:11 pm
by ragnarok2040
dlanor, for some reason, I thought it was a workaround for sending strings to the IOP. Now I can't seem to think of a reason why I thought that :?. I guess I just got stuck in a rut since the only arguments I've sent to the IOP are compacted multiple strings to ps2hdd and ps2fs.

Posted: Mon Jan 19, 2009 3:52 am
by dlanor
LionX wrote:one more Question: im under widows XP and when i check my network connection iformation it says that my dns server is "10.0.1.1" which is the same as my gateway.
This is quite normal when connected to a router or an ISP-supplied broadband modem (often contains a small local router too).
so i tried to set dns.irx to the same "10.0.1.1" and it return an error == -2 == DNS_ERROR_CONNECT witch means error connecting to dns server.
I'm not sure what kind of unit that "10.0.1.1" IP leads to, but if it is a modern router then it probably has various firewall settings, and one of those might limit the DNS service to 'speaking' only to the computer(s) directly connected to it, or possibly only to units requesting IP by DHCP, or any one of a number of other possibilities. As always, you need to familiarize yourself with your equipment in order to ensure correct configuration.
does this mean i got to use: "64.71.255.198"
I'm not sure where you got that address, but I assume you found it somewhere in your equipment (you never mentioned that), in which case it probably is the real IP address of some DNS server you've used, such as the one of your ISP.
what if that server goes down ?
Then it obviously won't reply any more. Of course, if it really is the ISP DNS server, then it is not likely to 'go down' without also being followed by your entire ISP connection going down, making any DNS access impossible.

But a greater risk is that the ISP simply switches to another IP for the DNS service, which your PC or router connection will be informed of automatically, and any unit in your LAN which uses the router for DNS will thus also continue to work well. So you really should try to reconfigure your stuff to allow all your equipment, including the PS2, to access your router/modem IP for DNS service.

Best regards: dlanor