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

« back to all changes in this revision

Viewing changes to source4/libcli/wrepl/winsrepl.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:
4
4
   structures for WINS replication client library
5
5
 
6
6
   Copyright (C) Andrew Tridgell 2005
 
7
   Copyright (C) Stefan Metzmacher 2005-2010
7
8
 
8
9
   This program is free software; you can redistribute it and/or modify
9
10
   it under the terms of the GNU General Public License as published by
22
23
#include "librpc/gen_ndr/nbt.h"
23
24
#include "librpc/gen_ndr/winsrepl.h"
24
25
 
25
 
/*
26
 
  main context structure for the wins replication client library
27
 
*/
28
 
struct wrepl_socket {
29
 
        struct socket_context *sock;
30
 
        struct packet_context *packet;
31
 
 
32
 
        struct {
33
 
                struct tevent_context *ctx;
34
 
                struct tevent_fd *fde;
35
 
        } event;
36
 
 
37
 
        /* a queue of replies waiting to be received */
38
 
        struct wrepl_request *recv_queue;
39
 
 
40
 
        /* the default timeout for requests, 0 means no timeout */
41
 
#define WREPL_SOCKET_REQUEST_TIMEOUT    (60)
42
 
        uint32_t request_timeout;
43
 
 
44
 
        /* counter for request timeouts, after 2 timeouts the socket is marked as dead */
45
 
        uint32_t timeout_count;
46
 
 
47
 
        /* remember is the socket is dead */
48
 
        bool dead;
49
 
 
50
 
        /* remember if we need to free the wrepl_socket at the end of wrepl_socket_dead() */
51
 
        bool free_skipped;
52
 
 
53
 
        struct smb_iconv_convenience *iconv_convenience;
54
 
};
 
26
struct wrepl_request;
 
27
struct wrepl_socket;
55
28
 
56
29
struct wrepl_send_ctrl {
57
30
        bool send_only;
58
31
        bool disconnect_after_send;
59
32
};
60
33
 
61
 
enum wrepl_request_state {
62
 
        WREPL_REQUEST_INIT  = 0,
63
 
        WREPL_REQUEST_RECV  = 1,
64
 
        WREPL_REQUEST_DONE  = 2,
65
 
        WREPL_REQUEST_ERROR = 3
66
 
};
67
 
 
68
 
/*
69
 
  a WINS replication request
70
 
*/
71
 
struct wrepl_request {
72
 
        struct wrepl_request *next, *prev;
73
 
        struct wrepl_socket *wrepl_socket;
74
 
 
75
 
        enum wrepl_request_state state;
76
 
        bool trigger;
77
 
        NTSTATUS status;
78
 
 
79
 
        struct tevent_timer *te;
80
 
 
81
 
        struct wrepl_packet *packet;
82
 
 
83
 
        struct {
84
 
                void (*fn)(struct wrepl_request *);
85
 
                void *private_data;
86
 
        } async;
87
 
};
88
 
 
89
 
 
90
34
/*
91
35
  setup an association
92
36
*/
129
73
        (type | (state << 2) | (node << 5) | \
130
74
         (is_static ? WREPL_FLAGS_IS_STATIC : 0))
131
75
 
 
76
struct wrepl_address {
 
77
        const char *owner;
 
78
        const char *address;
 
79
};
 
80
 
 
81
struct wrepl_name {
 
82
        struct nbt_name name;
 
83
        enum wrepl_name_type type;
 
84
        enum wrepl_name_state state;
 
85
        enum wrepl_name_node node;
 
86
        bool is_static;
 
87
        uint32_t raw_flags;
 
88
        uint64_t version_id;
 
89
        const char *owner;
 
90
        uint32_t num_addresses;
 
91
        struct wrepl_address *addresses;
 
92
};
 
93
 
132
94
/*
133
95
  a full pull replication
134
96
*/
139
101
        } in;
140
102
        struct {
141
103
                uint32_t num_names;
142
 
                struct wrepl_name {
143
 
                        struct nbt_name name;
144
 
                        enum wrepl_name_type type;
145
 
                        enum wrepl_name_state state;
146
 
                        enum wrepl_name_node node;
147
 
                        bool is_static;
148
 
                        uint32_t raw_flags;
149
 
                        uint64_t version_id;
150
 
                        const char *owner;
151
 
                        uint32_t num_addresses;
152
 
                        struct wrepl_address {
153
 
                                const char *owner;
154
 
                                const char *address;
155
 
                        } *addresses;
156
 
                } *names;
 
104
                struct wrepl_name *names;
157
105
        } out;
158
106
};
159
107
 
160
 
struct resolve_context;
 
108
struct tstream_context;
161
109
 
162
110
#include "libcli/wrepl/winsrepl_proto.h"