Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
At 07:52 18-11-2002, Derick Rethans wrote: On Mon, 18 Nov 2002, Marcus Börger wrote: I don't think so. It is only a small extension to the functionality we have already. If there would be more functionality to add during the next release cycle i would agree to move this to a new extension. But let's here the others. It's only 2 functions for now, IMO it doesn't warrant a new extention yet. Actually - I think it should be PHP_API'd. Any extension needing DNS lookups doesn't have to rewrite it's own routine then. Especially now that you can get any record type, I can see the usefullness. And of course a central place for all those different implemenations to maintain. With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
On Mon, 18 Nov 2002, Melvyn Sopacua wrote: At 07:52 18-11-2002, Derick Rethans wrote: On Mon, 18 Nov 2002, Marcus Börger wrote: I don't think so. It is only a small extension to the functionality we have already. If there would be more functionality to add during the next release cycle i would agree to move this to a new extension. But let's here the others. It's only 2 functions for now, IMO it doesn't warrant a new extention yet. Actually - I think it should be PHP_API'd. Any extension needing DNS lookups doesn't have to rewrite it's own routine then. Especially now that you can get any record type, I can see the usefullness. And of course a central place for all those different implemenations to maintain. Makes sense to me... Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
At 11:23 18.11.2002, Derick Rethans wrote: On Mon, 18 Nov 2002, Melvyn Sopacua wrote: At 07:52 18-11-2002, Derick Rethans wrote: On Mon, 18 Nov 2002, Marcus Börger wrote: I don't think so. It is only a small extension to the functionality we have already. If there would be more functionality to add during the next release cycle i would agree to move this to a new extension. But let's here the others. It's only 2 functions for now, IMO it doesn't warrant a new extention yet. Actually - I think it should be PHP_API'd. Any extension needing DNS lookups doesn't have to rewrite it's own routine then. Especially now that you can get any record type, I can see the usefullness. And of course a central place for all those different implemenations to maintain. Makes sense to me... Derick The first step should be making it a woring function with an agreed prototype and behaviour. I guess we would need some new datatype definitions to make this happen. So this would require some more work not needed directly. I made a new version which allows the use of a bitmask for the type parameter as suggested by Derick. You can now do dns_get_resord(...,DNS_ANY) dns_get_resord(...,DNS_ALL) dns_get_resord(...,DNS_MX) dns_get_resord(...,DNS_MX|DNS_SOA|...) DNS_ANY|DNS_xxx is not allowed. http://marcus-boerger.de/dns_get_record.diff marcus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0,NULL,buf.qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
I could do the autoconf stuff and i vould go for naming all these function dns_get_xx() and such. marcus At 12:38 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0,NULL,buf.qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
On Sun, 17 Nov 2002, Marcus Börger wrote: I could do the autoconf stuff and i vould go for naming all these function dns_get_xx() and such. nice, but I dont think we need to introduce (about) 10 functions which do basically the same thing except for returning a different record. What I meant was something like this: dns_get_record(php.net, DNS_MX); and of course having all the other DNS_* records defined as constant in PHP. We can then also wrap the original getmxrr() function to use this new function. Derick At 12:38 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0,NULL,buf..qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
Sure but anyway we would need to review the config file if everything we need is in place. marcus At 14:54 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002, Marcus Börger wrote: I could do the autoconf stuff and i vould go for naming all these function dns_get_xx() and such. nice, but I dont think we need to introduce (about) 10 functions which do basically the same thing except for returning a different record. What I meant was something like this: dns_get_record(php.net, DNS_MX); and of course having all the other DNS_* records defined as constant in PHP. We can then also wrap the original getmxrr() function to use this new function. Derick At 12:38 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0,NULL ,buf..qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
On Sun, 17 Nov 2002, Marcus Börger wrote: Sure but anyway we would need to review the config file if everything we need is in place. uhm, what config file? Derick At 14:54 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002, Marcus Börger wrote: I could do the autoconf stuff and i vould go for naming all these function dns_get_xx() and such. nice, but I dont think we need to introduce (about) 10 functions which do basically the same thing except for returning a different record. What I meant was something like this: dns_get_record(php.net, DNS_MX); and of course having all the other DNS_* records defined as constant in PHP. We can then also wrap the original getmxrr() function to use this new function. Derick At 12:38 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0,NULL ,buf..qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
I guessed we'd have to look into ext/standard/config.m4 for that new functionality. At 16:19 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002, Marcus Börger wrote: Sure but anyway we would need to review the config file if everything we need is in place. uhm, what config file? Derick At 14:54 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002, Marcus Börger wrote: I could do the autoconf stuff and i vould go for naming all these function dns_get_xx() and such. nice, but I dont think we need to introduce (about) 10 functions which do basically the same thing except for returning a different record. What I meant was something like this: dns_get_record(php.net, DNS_MX); and of course having all the other DNS_* records defined as constant in PHP. We can then also wrap the original getmxrr() function to use this new function. Derick At 12:38 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0, NULL ,buf..qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
On Sun, 17 Nov 2002, Marcus Börger wrote: I guessed we'd have to look into ext/standard/config.m4 for that new functionality. Ah, of course. Derick At 16:19 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002, Marcus Börger wrote: Sure but anyway we would need to review the config file if everything we need is in place. uhm, what config file? Derick At 14:54 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002, Marcus Börger wrote: I could do the autoconf stuff and i vould go for naming all these function dns_get_xx() and such. nice, but I dont think we need to introduce (about) 10 functions which do basically the same thing except for returning a different record. What I meant was something like this: dns_get_record(php.net, DNS_MX); and of course having all the other DNS_* records defined as constant in PHP. We can then also wrap the original getmxrr() function to use this new function. Derick At 12:38 17.11.2002, Derick Rethans wrote: On Sun, 17 Nov 2002 [EMAIL PROTECTED] wrote: Hello, Who can commit that now? I don't think it's ready yet. I agree with Marcus that the name of the function should be different then getanyrr(), it definitely doesn't fit into the naming things we have (with that getmxrr() doesn't fit either). I also think that the selection of the type of record to fetch should be made a constant so that we don't need to strncasecmp it everytime, and I would favor an implementation with zend_parse_parameters() to get rid of the (IMO) ugly parameter handling. Also, a lot of lines don't follow coding standards, like: n = res_nmkquery(res,QUERY,Z_STRVAL_P(host),C_IN,type_to_fetch,NULL,0, NULL ,buf..qb2,sizeof buf); instead of: n = res_nmkquery(res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof(buf)); And I miss autoconf checks for all those DNS functions (like res_mkquery, dn_expand) which might not exist on all platforms. regards, Derick Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
Wouldn't it make sense to move this to it's own extension? It would make it easier to maintain and keep the configure scripts readable.. :) --Jani On Sun, 17 Nov 2002, Marcus Börger wrote: Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
I don't think so. It is only a small extension to the functionality we have already. If there would be more functionality to add during the next release cycle i would agree to move this to a new extension. But let's here the others. marcus At 02:47 18.11.2002, Jani Taskinen wrote: Wouldn't it make sense to move this to it's own extension? It would make it easier to maintain and keep the configure scripts readable.. :) --Jani On Sun, 17 Nov 2002, Marcus Börger wrote: Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr()function addition
On Mon, 18 Nov 2002, Marcus Börger wrote: I don't think so. It is only a small extension to the functionality we have already. If there would be more functionality to add during the next release cycle i would agree to move this to a new extension. But let's here the others. It's only 2 functions for now, IMO it doesn't warrant a new extention yet. Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. --- dns.c Sat Nov 16 13:31:51 2002 +++ dns.c Sat Nov 16 15:04:07 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: dns.c,v 1.44 2002/10/18 22:08:23 sniper Exp $ */ +/* $Id: dns.c,v 1.44 2002/11/16 14:51:58 pollita Exp $ */ /* {{{ includes */ @@ -276,6 +276,252 @@ #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif /* MAXHOSTNAMELEN */ + +#ifndef MAXRESOURCERECORDS +#define MAXRESOURCERECORDS 64 +#endif /* MAXRESOURCERECORDS */ + +/* {{{ php_parserr + */ +u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, zval **subarray) +{ + u_short type, class, dlen; + u_long ttl; + long n, i; + char name[MAXHOSTNAMELEN]; + + n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof name) - 2); + if (n 0) { + return NULL; + } + cp += n; + + GETSHORT(type,cp); + GETSHORT(class,cp); + GETLONG(ttl,cp); + GETSHORT(dlen,cp); + if (type_to_fetch != T_ANY type != type_to_fetch) { + /* Should never actually occour */ + cp += dlen; + return NULL; + } + + MAKE_STD_ZVAL(*subarray); + if (array_init(*subarray) != SUCCESS) { + return NULL; + } + add_assoc_string(*subarray,host,name,1); + + switch (type) { + case T_A: + add_assoc_string(*subarray,type,A,1); + sprintf(name,%d.%d.%d.%d,cp[0],cp[1],cp[2],cp[3]); + add_assoc_string(*subarray,ip,name,1); + cp += dlen; + break; + case T_MX: + add_assoc_string(*subarray,type,MX,1); + GETSHORT(n,cp); + add_assoc_long(*subarray,pri,n); + case T_CNAME: + if (type == T_CNAME) + add_assoc_string(*subarray,type,CNAME,1); + case T_NS: + if (type == T_NS) + add_assoc_string(*subarray,type,NS,1); + case T_PTR: + if (type == T_PTR) + add_assoc_string(*subarray,type,PTR,1); + n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof +name) - 2); + if (n 0) { + return NULL; + } + cp += n; + add_assoc_string(*subarray,target,name,1); + break; + case T_HINFO: + /* See RFC 1010 for values */ + GETSHORT(n,cp); + add_assoc_long(*subarray,cpu,n); + GETSHORT(n,cp); + add_assoc_long(*subarray,os,n); + break; + case T_TXT: + add_assoc_string(*subarray,type,TXT,1); + n = cp[0]; + for(i=1; i=n; i++) + name[i-1] = cp[i]; + name[i-1] = '\0'; + cp += dlen; + add_assoc_string(*subarray,txt,name,1); + break; + case T_SOA: + add_assoc_string(*subarray,type,SOA,1); + n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof +name) -2); + if (n 0) { + return NULL; + } + cp += n; + add_assoc_string(*subarray,mname,name,1); + n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof +name) -2); + if (n 0) { + return NULL; + } + cp += n; + add_assoc_string(*subarray,rname,name,1); + GETLONG(n,cp); + add_assoc_long(*subarray,serial,n); + GETLONG(n,cp); + add_assoc_long(*subarray,refresh,n); + GETLONG(n,cp); + add_assoc_long(*subarray,retry,n); + GETLONG(n,cp); + add_assoc_long(*subarray,expire,n); + GETLONG(n,cp); + add_assoc_long(*subarray,minimum-ttl,n); + break; + default: + cp += dlen; + } + + add_assoc_string(*subarray,class,IN,1); + add_assoc_long(*subarray,ttl,ttl); + + return cp; +} +/* }}} */ + +/* {{{ proto array getanyrr(string hostname [, string type[, array authns, array
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php cvs -z3 -q diff basic_functions.c dns.c dns.h (in directory S:\php4-HEAD\ext\standard) Index: basic_functions.c === RCS file: /repository/php4/ext/standard/basic_functions.c,v retrieving revision 1.543 diff -u -r1.543 basic_functions.c --- basic_functions.c 8 Nov 2002 15:49:32 - 1.543 +++ basic_functions.c 17 Nov 2002 00:15:19 - @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.543 2002/11/08 15:49:32 sterling Exp $ */ +/* $Id: basic_functions.c,v 1.543 2002/11/16 13:18:21 pollita Exp $ */ #include php.h #include php_streams.h @@ -440,6 +440,7 @@ #if HAVE_RES_SEARCH !(defined(__BEOS__) || defined(PHP_WIN32) || defined(NETWARE)) PHP_FE(checkdnsrr, NULL) +PHP_FE(getanyrr,third_and_rest_force_ref) PHP_FE(getmxrr,second_and_third_args_force_ref) #endif Index: dns.c === RCS file: /repository/php4/ext/standard/dns.c,v retrieving revision 1.44 diff -u -r1.44 dns.c --- dns.c 18 Oct 2002 22:08:23 - 1.44 +++ dns.c 17 Nov 2002 00:15:20 - @@ -16,7 +16,7 @@ +--+ */ -/* $Id: dns.c,v 1.44 2002/10/18 22:08:23 sniper Exp $ */ +/* $Id: dns.c,v 1.44 2002/11/16 14:51:58 pollita Exp $ */ /* {{{ includes */ @@ -71,6 +71,13 @@ #include dns.h /* }}} */ +#if HAVE_RES_SEARCH !(defined(__BEOS__)||defined(PHP_WIN32)) +typedef union { + HEADER qb1; + u_char qb2[65536]; +} querybuf; +#endif + static char *php_gethostbyaddr(char *ip); static char *php_gethostbyname(char *name); @@ -276,6 +283,251 @@ #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif /* MAXHOSTNAMELEN */ + +#ifndef MAXRESOURCERECORDS +#define MAXRESOURCERECORDS 64 +#endif /* MAXRESOURCERECORDS */ + +/* {{{ php_parserr + */ +u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, zval **subarray) +{ + u_short type, class, dlen; + u_long ttl; + long n, i; + char name[MAXHOSTNAMELEN]; + + n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof name) - 2); + if (n 0) { + return NULL; + } + cp += n; + + GETSHORT(type,cp); + GETSHORT(class,cp); + GETLONG(ttl,cp); + GETSHORT(dlen,cp); + if (type_to_fetch != T_ANY type != type_to_fetch) { + /* Should never actually occour */ + cp += dlen; + return NULL; + } + + MAKE_STD_ZVAL(*subarray); + if (array_init(*subarray) != SUCCESS) { + return NULL; + } + add_assoc_string(*subarray,host,name,1); + + switch (type) { + case T_A: + add_assoc_string(*subarray,type,A,1); + sprintf(name,%d.%d.%d.%d,cp[0],cp[1],cp[2],cp[3]); + add_assoc_string(*subarray,ip,name,1); + cp += dlen; + break; + case T_MX: + add_assoc_string(*subarray,type,MX,1); + GETSHORT(n,cp); + add_assoc_long(*subarray,pri,n); + case T_CNAME: + if (type == T_CNAME) + add_assoc_string(*subarray,type,CNAME,1); + case T_NS: + if (type == T_NS) + add_assoc_string(*subarray,type,NS,1); + case T_PTR: + if (type == T_PTR) + add_assoc_string(*subarray,type,PTR,1); + n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof +name) - 2); + if (n 0) { + return NULL; + } + cp += n; + add_assoc_string(*subarray,target,name,1); + break; + case T_HINFO: + /* See RFC 1010 for values */ + GETSHORT(n,cp); + add_assoc_long(*subarray,cpu,n); + GETSHORT(n,cp); + add_assoc_long(*subarray,os,n); + break; + case T_TXT: + add_assoc_string(*subarray,type,TXT,1); +
Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition
Hello, Who can commit that now? Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Marcus Börger [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Function is nice but the function name is not. Attached is a second revised patch that fixes the build problems. marcus At 00:11 17.11.2002, Pollita wrote: Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to ext/standard/dns.c for addition of getanyrr() function. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php