1## Domain Registry Interface, .US policies 2## 3## Copyright (c) 2007,2008,2009 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>, 4## All rights reserved. 5## 6## This file is part of Net::DRI 7## 8## Net::DRI is free software; you can redistribute it and/or modify 9## it under the terms of the GNU General Public License as published by 10## the Free Software Foundation; either version 2 of the License, or 11## (at your option) any later version. 12## 13## See the LICENSE file that comes with this distribution for more details. 14# 15# 16# 17#################################################################################################### 18 19package Net::DRI::DRD::US; 20 21use strict; 22use warnings; 23 24use base qw/Net::DRI::DRD/; 25 26use DateTime::Duration; 27use Net::DRI::Data::Contact::US; 28 29our $VERSION=do { my @r=(q$Revision: 1.6 $=~/\d+/g); sprintf("%d".".%02d" x $#r, @r); }; 30 31=pod 32 33=head1 NAME 34 35Net::DRI::DRD::US - .US policies for Net::DRI 36 37=head1 DESCRIPTION 38 39Please see the README file for details. 40 41=head1 SUPPORT 42 43For now, support questions should be sent to: 44 45E<lt>netdri@dotandco.comE<gt> 46 47Please also see the SUPPORT file in the distribution. 48 49=head1 SEE ALSO 50 51E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> 52 53=head1 AUTHOR 54 55Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> 56 57=head1 COPYRIGHT 58 59Copyright (c) 2007,2008,2009 Tonnerre Lombard E<lt>tonnerre.lombard@sygroup.chE<gt>, 60All rights reserved. 61 62This program is free software; you can redistribute it and/or modify 63it under the terms of the GNU General Public License as published by 64the Free Software Foundation; either version 2 of the License, or 65(at your option) any later version. 66 67See the LICENSE file that comes with this distribution for more details. 68 69=cut 70 71#################################################################################################### 72 73sub new 74{ 75 my $class=shift; 76 my $self=$class->SUPER::new(@_); 77 $self->{info}->{host_as_attr}=0; 78 $self->{info}->{contact_i18n}=6; ## INT only or INT+LOC (but not LOC only) 79 bless($self,$class); 80 return $self; 81} 82 83sub periods { return map { DateTime::Duration->new(years => $_) } (1..10); } 84sub name { return 'US'; } 85sub tlds { return ('us'); } 86sub object_types { return ('domain','contact','ns'); } 87sub profile_types { return qw/epp whois/; } 88 89sub transport_protocol_default 90{ 91 my ($self,$type)=@_; 92 93 return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::US',{}) if $type eq 'epp'; 94 return ('Net::DRI::Transport::Socket',{remote_host=>'whois.nic.us'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois'; 95 return; 96} 97 98sub set_factories 99{ 100 my ($self,$po)=@_; 101 $po->factories('contact',sub { return Net::DRI::Data::Contact::US->new(@_); }); 102} 103 104#################################################################################################### 105 106sub verify_name_domain 107{ 108 my ($self,$ndr,$domain,$op)=@_; 109 return $self->_verify_name_rules($domain,$op,{check_name => 1, 110 my_tld => 1, 111 icann_reserved => 1, 112 }); 113} 114 115#################################################################################################### 1161; 117