commit acde2ece8cffdb0ff63a063924799264a45eb9df
parent 2c852f0485fa019e1eee988ab8df80168dbcfedc
Author: ukai <ukai>
Date: Mon, 22 Sep 2003 17:37:40 +0000
[w3m-dev 03967] Re: IPv4/IPv6 only option patch
* NEWS: options: -4, -6
* fm.h (DNS_ORDER_INET_ONLY): added
(DNS_ORDER_INET6_ONLY): added
(ai_family_order_table): [3]->[7]
* main.c (fusage): add -4/-6
(main): -4/-6 mapped to dns_order=4/dns_order=6
* rc.c (dnsorders): add DNS_ORDER_INET_ONLY, DNS_ORDER_INET6_ONLY
* url.c (dnsorders): add 3-6
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
6 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,15 @@
+2003-09-23 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev 03967] Re: IPv4/IPv6 only option patch
+ * NEWS: options: -4, -6
+ * fm.h (DNS_ORDER_INET_ONLY): added
+ (DNS_ORDER_INET6_ONLY): added
+ (ai_family_order_table): [3]->[7]
+ * main.c (fusage): add -4/-6
+ (main): -4/-6 mapped to dns_order=4/dns_order=6
+ * rc.c (dnsorders): add DNS_ORDER_INET_ONLY, DNS_ORDER_INET6_ONLY
+ * url.c (dnsorders): add 3-6
+
2003-09-16 Hiroyuki Ito <hito@crl.go.jp>
* [w3m-dev 03960]
diff --git a/NEWS b/NEWS
@@ -1,5 +1,6 @@
w3m 0.5 or 1.0?
+* options: -4, -6
* configuration file in $(sysconfdir)/$(package)/
* func: NEXT_VISITED, PREV_VISITED
* autoconfiscate
diff --git a/fm.h b/fm.h
@@ -824,8 +824,10 @@ global int NOproxy_netaddr init(TRUE);
#define DNS_ORDER_UNSPEC 0
#define DNS_ORDER_INET_INET6 1
#define DNS_ORDER_INET6_INET 2
+#define DNS_ORDER_INET_ONLY 4
+#define DNS_ORDER_INET6_ONLY 6
global int DNS_order init(DNS_ORDER_UNSPEC);
-extern int ai_family_order_table[3][3]; /* XXX */
+extern int ai_family_order_table[7][3]; /* XXX */
#endif /* INET6 */
global TextList *NO_proxy_domains;
global char NoCache init(FALSE);
diff --git a/main.c b/main.c
@@ -221,6 +221,10 @@ fusage(FILE * f, int err)
fprintf(f, " +<num> goto <num> line\n");
fprintf(f, " -num show line number\n");
fprintf(f, " -no-proxy don't use proxy\n");
+#ifdef INET6
+ fprintf(f, " -4 IPv4 only (-o dns_order=4)\n");
+ fprintf(f, " -6 IPv6 only (-o dns_order=6)\n");
+#endif
#ifdef USE_MOUSE
fprintf(f, " -no-mouse don't use mouse\n");
#endif /* USE_MOUSE */
@@ -608,6 +612,10 @@ main(int argc, char **argv, char **envp)
showLineNum = TRUE;
else if (!strcmp("-no-proxy", argv[i]))
use_proxy = FALSE;
+#ifdef INET6
+ else if (!strcmp("-4", argv[i]) || !strcmp("-6", argv[i]))
+ set_param_option(Sprintf("dns_order=%c", argv[i][1])->ptr);
+#endif
else if (!strcmp("-post", argv[i])) {
if (++i >= argc)
usage();
diff --git a/rc.c b/rc.c
@@ -470,6 +470,8 @@ static struct sel_c dnsorders[] = {
{N_S(DNS_ORDER_UNSPEC), "unspecified"},
{N_S(DNS_ORDER_INET_INET6), "inet inet6"},
{N_S(DNS_ORDER_INET6_INET), "inet6 inet"},
+ {N_S(DNS_ORDER_INET_ONLY), "inet only"},
+ {N_S(DNS_ORDER_INET6_ONLY), "inet6 only"},
{0, NULL, NULL}
};
#endif /* INET6 */
diff --git a/url.c b/url.c
@@ -33,10 +33,14 @@
#ifdef INET6
/* see rc.c, "dns_order" and dnsorders[] */
-int ai_family_order_table[3][3] = {
+int ai_family_order_table[7][3] = {
{PF_UNSPEC, PF_UNSPEC, PF_UNSPEC}, /* 0:unspec */
{PF_INET, PF_INET6, PF_UNSPEC}, /* 1:inet inet6 */
- {PF_INET6, PF_INET, PF_UNSPEC} /* 2:inet6 inet */
+ {PF_INET6, PF_INET, PF_UNSPEC}, /* 2:inet6 inet */
+ {PF_UNSPEC, PF_UNSPEC, PF_UNSPEC}, /* 3: --- */
+ {PF_INET, PF_UNSPEC, PF_UNSPEC}, /* 4:inet */
+ {PF_UNSPEC, PF_UNSPEC, PF_UNSPEC}, /* 5: --- */
+ {PF_INET6, PF_UNSPEC, PF_UNSPEC}, /* 6:inet6 */
};
#endif /* INET6 */