your_ip_to_ip
authorAdam Chlipala <adamc@hcoop.net>
Sun, 18 Nov 2007 18:09:56 +0000 (18:09 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sun, 18 Nov 2007 18:09:56 +0000 (18:09 +0000)
lib/domain.dtl
lib/easy_domain.dtl
src/domain.sml

index 8946633..2b17089 100644 (file)
@@ -10,6 +10,7 @@ extern type ip;
 {{An IP address}}
 
 extern type your_ip;
 {{An IP address}}
 
 extern type your_ip;
+extern val your_ip_to_ip : your_ip -> ip;
 {{An IP address that you're authorized to use; e.g., for an SSL web host}}
 
 extern type host;
 {{An IP address that you're authorized to use; e.g., for an SSL web host}}
 
 extern type host;
index 82c66bf..c4b3d4f 100644 (file)
@@ -17,6 +17,19 @@ val webAt =
 
 val web = webAt web_node;
 
 
 val web = webAt web_node;
 
+val webAtIp =
+       \ ip : (your_ip) ->
+       \ host : (host) ->
+       \\ config : Vhost -> begin
+         dns (dnsA host (your_ip_to_ip ip));
+
+         vhost host where
+           WebPlaces = [web_place web_node ip]
+         with
+           config
+         end
+       end;
+
 val addDefaultAlias = begin
   mailbox <- Mailbox;
   defaultAlias mailbox
 val addDefaultAlias = begin
   mailbox <- Mailbox;
   defaultAlias mailbox
index 6d7f2ac..3998b83 100644 (file)
@@ -191,6 +191,10 @@ val _ = Env.type_one "node"
        Env.string
        validNode
 
        Env.string
        validNode
 
+val _ = Env.registerFunction ("your_ip_to_ip",
+                             fn [e] => SOME e
+                              | _ => NONE)
+
 val _ = Env.registerFunction ("dns_node_to_node",
                              fn [e] => SOME e
                               | _ => NONE)
 val _ = Env.registerFunction ("dns_node_to_node",
                              fn [e] => SOME e
                               | _ => NONE)