~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to lib/util/util_net.h

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
                                       const char *str,
44
44
                                       int flags);
45
45
 
 
46
void set_sockaddr_port(struct sockaddr *psa, uint16_t port);
 
47
 
 
48
/**
 
49
 Check if an IP is the 0.0.0.0.
 
50
**/
 
51
_PUBLIC_ bool is_zero_ip_v4(struct in_addr ip);
 
52
 
 
53
void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
 
54
                                 struct in_addr ip);
 
55
#if defined(HAVE_IPV6)
 
56
/**
 
57
 * Convert an IPv6 struct in_addr to a struct sockaddr_storage.
 
58
 */
 
59
void in6_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
 
60
                                  struct in6_addr ip);
 
61
#endif
 
62
/**
 
63
 Are two IPs on the same subnet?
 
64
**/
 
65
_PUBLIC_ bool same_net_v4(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
 
66
 
 
67
/**
 
68
 Return true if a string could be a pure IP address.
 
69
**/
 
70
_PUBLIC_ bool is_ipaddress(const char *str);
 
71
 
 
72
bool is_broadcast_addr(const struct sockaddr *pss);
 
73
bool is_loopback_ip_v4(struct in_addr ip);
 
74
bool is_loopback_addr(const struct sockaddr *pss);
 
75
bool is_zero_addr(const struct sockaddr_storage *pss);
 
76
void zero_ip_v4(struct in_addr *ip);
 
77
/**
 
78
 Interpret an internet address or name into an IP address in 4 byte form.
 
79
**/
 
80
_PUBLIC_ uint32_t interpret_addr(const char *str);
 
81
 
 
82
/**
 
83
 A convenient addition to interpret_addr().
 
84
**/
 
85
_PUBLIC_ struct in_addr interpret_addr2(const char *str);
 
86
 
 
87
_PUBLIC_ bool is_ipaddress_v4(const char *str);
 
88
 
 
89
bool is_address_any(const struct sockaddr *psa);
 
90
bool same_net(const struct sockaddr *ip1,
 
91
              const struct sockaddr *ip2,
 
92
              const struct sockaddr *mask);
 
93
bool sockaddr_equal(const struct sockaddr *ip1,
 
94
                    const struct sockaddr *ip2);
 
95
 
 
96
bool is_address_any(const struct sockaddr *psa);
 
97
uint16_t get_sockaddr_port(const struct sockaddr_storage *pss);
 
98
char *print_sockaddr_len(char *dest,
 
99
                         size_t destlen,
 
100
                         const struct sockaddr *psa,
 
101
                         socklen_t psalen);
 
102
char *print_sockaddr(char *dest,
 
103
                        size_t destlen,
 
104
                        const struct sockaddr_storage *psa);
 
105
char *print_canonical_sockaddr(TALLOC_CTX *ctx,
 
106
                        const struct sockaddr_storage *pss);
 
107
const char *client_name(int fd);
 
108
int get_socket_port(int fd);
 
109
const char *client_socket_addr(int fd, char *addr, size_t addr_len);
 
110
 
46
111
#endif /* _SAMBA_UTIL_NET_H_ */