Changeset 745 for trunk/server/source4/nbt_server/wins
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/nbt_server/wins/wins_hook.c
r414 r745 62 62 rec->name->name, 63 63 rec->name->type, 64 rec->expire_time);64 (long int) rec->expire_time); 65 65 if (!cmd) goto failed; 66 66 -
trunk/server/source4/nbt_server/wins/wins_ldb.c
r414 r745 32 32 #include "nbt_server/nbt_server.h" 33 33 #include "nbt_server/wins/winsdb.h" 34 #include "lib/ldb/include/ldb_module.h"34 #include <ldb_module.h> 35 35 #include "system/network.h" 36 36 #include "lib/socket/netif.h" … … 90 90 ldb_module_set_private(module, NULL); 91 91 92 owner = lp _parm_string(lp_ctx, NULL, "winsdb", "local_owner");92 owner = lpcfg_parm_string(lp_ctx, NULL, "winsdb", "local_owner"); 93 93 if (!owner) { 94 94 struct interface *ifaces; 95 load_interfaces(module, lp _interfaces(lp_ctx), &ifaces);95 load_interfaces(module, lpcfg_interfaces(lp_ctx), &ifaces); 96 96 owner = iface_n_ip(ifaces, 0); 97 97 if (!owner) { … … 114 114 } 115 115 116 _PUBLIC_const struct ldb_module_ops ldb_wins_ldb_module_ops = {116 static const struct ldb_module_ops ldb_wins_ldb_module_ops = { 117 117 .name = "wins_ldb", 118 118 .add = wins_ldb_verify, … … 120 120 .init_context = wins_ldb_init 121 121 }; 122 123 int ldb_wins_ldb_module_init(const char *version) 124 { 125 LDB_MODULE_CHECK_VERSION(version); 126 return ldb_register_module(&ldb_wins_ldb_module_ops); 127 } -
trunk/server/source4/nbt_server/wins/winsclient.c
r414 r745 29 29 #include "param/param.h" 30 30 31 static void nbtd_wins_refresh_handler(struct composite_context *c);32 33 31 /* we send WINS client requests using our primary network interface 34 32 */ … … 59 57 { 60 58 uint32_t refresh_time; 61 uint32_t max_refresh_time = lp _parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200);59 uint32_t max_refresh_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200); 62 60 63 61 refresh_time = MIN(max_refresh_time, iname->ttl/2); … … 69 67 } 70 68 69 struct nbtd_wins_refresh_state { 70 struct nbtd_iface_name *iname; 71 struct nbt_name_refresh_wins io; 72 }; 73 71 74 /* 72 75 called when a wins name refresh has completed 73 76 */ 74 static void nbtd_wins_refresh_handler(struct composite_context *c)77 static void nbtd_wins_refresh_handler(struct tevent_req *subreq) 75 78 { 76 79 NTSTATUS status; 77 struct nbt_name_refresh_wins io; 78 struct nbtd_iface_name *iname = talloc_get_type(c->async.private_data, 79 struct nbtd_iface_name); 80 TALLOC_CTX *tmp_ctx = talloc_new(iname); 81 82 status = nbt_name_refresh_wins_recv(c, tmp_ctx, &io); 80 struct nbtd_wins_refresh_state *state = 81 tevent_req_callback_data(subreq, 82 struct nbtd_wins_refresh_state); 83 struct nbtd_iface_name *iname = state->iname; 84 85 status = nbt_name_refresh_wins_recv(subreq, state, &state->io); 86 TALLOC_FREE(subreq); 83 87 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { 84 88 /* our WINS server is dead - start registration over 85 89 from scratch */ 86 90 DEBUG(2,("Failed to refresh %s with WINS server %s\n", 87 nbt_name_string( tmp_ctx, &iname->name), iname->wins_server));88 talloc_free( tmp_ctx);91 nbt_name_string(state, &iname->name), iname->wins_server)); 92 talloc_free(state); 89 93 nbtd_winsclient_register(iname); 90 94 return; … … 93 97 if (!NT_STATUS_IS_OK(status)) { 94 98 DEBUG(1,("Name refresh failure with WINS for %s - %s\n", 95 nbt_name_string( tmp_ctx, &iname->name), nt_errstr(status)));96 talloc_free( tmp_ctx);97 return; 98 } 99 100 if ( io.out.rcode != 0) {99 nbt_name_string(state, &iname->name), nt_errstr(status))); 100 talloc_free(state); 101 return; 102 } 103 104 if (state->io.out.rcode != 0) { 101 105 DEBUG(1,("WINS server %s rejected name refresh of %s - %s\n", 102 io.out.wins_server, nbt_name_string(tmp_ctx, &iname->name), 103 nt_errstr(nbt_rcode_to_ntstatus(io.out.rcode)))); 106 state->io.out.wins_server, 107 nbt_name_string(state, &iname->name), 108 nt_errstr(nbt_rcode_to_ntstatus(state->io.out.rcode)))); 104 109 iname->nb_flags |= NBT_NM_CONFLICT; 105 talloc_free( tmp_ctx);110 talloc_free(state); 106 111 return; 107 112 } 108 113 109 114 DEBUG(4,("Refreshed name %s with WINS server %s\n", 110 nbt_name_string( tmp_ctx, &iname->name), iname->wins_server));115 nbt_name_string(state, &iname->name), iname->wins_server)); 111 116 /* success - start a periodic name refresh */ 112 117 iname->nb_flags |= NBT_NM_ACTIVE; … … 116 121 * so steal it into the tmp context 117 122 */ 118 talloc_steal(tmp_ctx, iname->wins_server); 119 } 120 iname->wins_server = talloc_steal(iname, io.out.wins_server); 121 123 talloc_steal(state, iname->wins_server); 124 } 125 iname->wins_server = talloc_move(iname, &state->io.out.wins_server); 122 126 iname->registration_time = timeval_current(); 127 128 talloc_free(state); 129 123 130 nbtd_wins_start_refresh_timer(iname); 124 125 talloc_free(tmp_ctx);126 131 } 127 132 … … 135 140 struct nbtd_iface_name *iname = talloc_get_type(private_data, struct nbtd_iface_name); 136 141 struct nbtd_interface *iface = iname->iface; 137 struct nbt_name_refresh_wins io; 138 struct composite_context *c; 139 TALLOC_CTX *tmp_ctx = talloc_new(iname); 142 struct nbt_name_socket *nbtsock = wins_socket(iface); 143 struct tevent_req *subreq; 144 struct nbtd_wins_refresh_state *state; 145 146 state = talloc_zero(iname, struct nbtd_wins_refresh_state); 147 if (state == NULL) { 148 return; 149 } 150 151 state->iname = iname; 140 152 141 153 /* setup a wins name refresh request */ 142 io.in.name = iname->name;143 io.in.wins_servers = (const char **)str_list_make_single(tmp_ctx, iname->wins_server);144 io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);145 io.in.addresses = nbtd_address_list(iface, tmp_ctx);146 io.in.nb_flags = iname->nb_flags;147 io.in.ttl = iname->ttl;148 149 if (! io.in.addresses) {150 talloc_free( tmp_ctx);151 return; 152 } 153 154 c = nbt_name_refresh_wins_send(wins_socket(iface), &io);155 if ( c== NULL) {156 talloc_free( tmp_ctx);157 return; 158 } 159 talloc_steal(c, io.in.addresses); 160 161 c->async.fn = nbtd_wins_refresh_handler; 162 c->async.private_data = iname; 163 164 talloc_free(tmp_ctx);165 } 166 154 state->io.in.name = iname->name; 155 state->io.in.wins_servers = (const char **)str_list_make_single(state, iname->wins_server); 156 state->io.in.wins_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); 157 state->io.in.addresses = nbtd_address_list(iface, state); 158 state->io.in.nb_flags = iname->nb_flags; 159 state->io.in.ttl = iname->ttl; 160 161 if (!state->io.in.addresses) { 162 talloc_free(state); 163 return; 164 } 165 166 subreq = nbt_name_refresh_wins_send(state, ev, nbtsock, &state->io); 167 if (subreq == NULL) { 168 talloc_free(state); 169 return; 170 } 171 172 tevent_req_set_callback(subreq, nbtd_wins_refresh_handler, state); 173 } 174 175 struct nbtd_wins_register_state { 176 struct nbtd_iface_name *iname; 177 struct nbt_name_register_wins io; 178 }; 167 179 168 180 /* 169 181 called when a wins name register has completed 170 182 */ 171 static void nbtd_wins_register_handler(struct composite_context *c)183 static void nbtd_wins_register_handler(struct tevent_req *subreq) 172 184 { 173 185 NTSTATUS status; 174 struct nbt_name_register_wins io; 175 struct nbtd_iface_name *iname = talloc_get_type(c->async.private_data, 176 struct nbtd_iface_name); 177 TALLOC_CTX *tmp_ctx = talloc_new(iname); 178 179 status = nbt_name_register_wins_recv(c, tmp_ctx, &io); 186 struct nbtd_wins_register_state *state = 187 tevent_req_callback_data(subreq, 188 struct nbtd_wins_register_state); 189 struct nbtd_iface_name *iname = state->iname; 190 191 status = nbt_name_register_wins_recv(subreq, state, &state->io); 192 TALLOC_FREE(subreq); 180 193 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { 181 194 /* none of the WINS servers responded - try again 182 195 periodically */ 183 int wins_retry_time = lp _parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "wins_retry", 300);196 int wins_retry_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "wins_retry", 300); 184 197 event_add_timed(iname->iface->nbtsrv->task->event_ctx, 185 198 iname, … … 187 200 nbtd_wins_register_retry, 188 201 iname); 189 talloc_free( tmp_ctx);202 talloc_free(state); 190 203 return; 191 204 } … … 193 206 if (!NT_STATUS_IS_OK(status)) { 194 207 DEBUG(1,("Name register failure with WINS for %s - %s\n", 195 nbt_name_string( tmp_ctx, &iname->name), nt_errstr(status)));196 talloc_free( tmp_ctx);208 nbt_name_string(state, &iname->name), nt_errstr(status))); 209 talloc_free(state); 197 210 return; 198 211 } 199 212 200 if ( io.out.rcode != 0) {213 if (state->io.out.rcode != 0) { 201 214 DEBUG(1,("WINS server %s rejected name register of %s - %s\n", 202 io.out.wins_server, nbt_name_string(tmp_ctx, &iname->name), 203 nt_errstr(nbt_rcode_to_ntstatus(io.out.rcode)))); 215 state->io.out.wins_server, 216 nbt_name_string(state, &iname->name), 217 nt_errstr(nbt_rcode_to_ntstatus(state->io.out.rcode)))); 204 218 iname->nb_flags |= NBT_NM_CONFLICT; 205 talloc_free( tmp_ctx);219 talloc_free(state); 206 220 return; 207 221 } … … 214 228 * so steal it into the tmp context 215 229 */ 216 talloc_steal( tmp_ctx, iname->wins_server);217 } 218 iname->wins_server = talloc_ steal(iname,io.out.wins_server);230 talloc_steal(state, iname->wins_server); 231 } 232 iname->wins_server = talloc_move(iname, &state->io.out.wins_server); 219 233 220 234 iname->registration_time = timeval_current(); 235 236 DEBUG(3,("Registered %s with WINS server %s\n", 237 nbt_name_string(state, &iname->name), iname->wins_server)); 238 239 talloc_free(state); 240 221 241 nbtd_wins_start_refresh_timer(iname); 222 223 DEBUG(3,("Registered %s with WINS server %s\n",224 nbt_name_string(tmp_ctx, &iname->name), iname->wins_server));225 226 talloc_free(tmp_ctx);227 242 } 228 243 … … 233 248 { 234 249 struct nbtd_interface *iface = iname->iface; 235 struct nbt_name_register_wins io; 236 struct composite_context *c; 250 struct nbt_name_socket *nbtsock = wins_socket(iface); 251 struct nbtd_wins_register_state *state; 252 struct tevent_req *subreq; 253 254 state = talloc_zero(iname, struct nbtd_wins_register_state); 255 if (state == NULL) { 256 return; 257 } 258 259 state->iname = iname; 237 260 238 261 /* setup a wins name register request */ 239 io.in.name= iname->name;240 io.in.wins_port = lp_nbt_port(iname->iface->nbtsrv->task->lp_ctx);241 io.in.wins_servers = lp_wins_server_list(iname->iface->nbtsrv->task->lp_ctx);242 io.in.addresses = nbtd_address_list(iface, iname);243 io.in.nb_flags= iname->nb_flags;244 io.in.ttl= iname->ttl;245 246 if ( !io.in.addresses) {247 return;248 }249 250 c = nbt_name_register_wins_send(wins_socket(iface), &io); 251 if (c == NULL) {252 talloc_free(io.in.addresses);253 return;254 }255 talloc_steal(c, io.in.addresses);256 257 c->async.fn = nbtd_wins_register_handler; 258 c->async.private_data = iname;259 } 262 state->io.in.name = iname->name; 263 state->io.in.wins_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); 264 state->io.in.wins_servers = lpcfg_wins_server_list(iface->nbtsrv->task->lp_ctx); 265 state->io.in.addresses = nbtd_address_list(iface, state); 266 state->io.in.nb_flags = iname->nb_flags; 267 state->io.in.ttl = iname->ttl; 268 269 if (state->io.in.addresses == NULL) { 270 talloc_free(state); 271 return; 272 } 273 274 subreq = nbt_name_register_wins_send(state, iface->nbtsrv->task->event_ctx, 275 nbtsock, &state->io); 276 if (subreq == NULL) { 277 talloc_free(state); 278 return; 279 } 280 281 tevent_req_set_callback(subreq, nbtd_wins_register_handler, state); 282 } -
trunk/server/source4/nbt_server/wins/winsdb.c
r414 r745 24 24 #include "nbt_server/nbt_server.h" 25 25 #include "nbt_server/wins/winsdb.h" 26 #include "lib/ldb/include/ldb.h"27 #include "lib/ldb/include/ldb_errors.h"26 #include <ldb.h> 27 #include <ldb_errors.h> 28 28 #include "librpc/gen_ndr/ndr_nbt.h" 29 29 #include "system/time.h" … … 101 101 102 102 ret = ldb_msg_add_empty(msg, "objectClass", LDB_FLAG_MOD_REPLACE, NULL); 103 if (ret != 0) goto failed;103 if (ret != LDB_SUCCESS) goto failed; 104 104 ret = ldb_msg_add_string(msg, "objectClass", "winsMaxVersion"); 105 if (ret != 0) goto failed;105 if (ret != LDB_SUCCESS) goto failed; 106 106 ret = ldb_msg_add_empty(msg, "maxVersion", LDB_FLAG_MOD_REPLACE, NULL); 107 if (ret != 0) goto failed;107 if (ret != LDB_SUCCESS) goto failed; 108 108 ret = ldb_msg_add_fmt(msg, "maxVersion", "%llu", (long long)newMaxVersion); 109 if (ret != 0) goto failed;109 if (ret != LDB_SUCCESS) goto failed; 110 110 111 111 ret = ldb_modify(wins_db, msg); 112 if (ret != 0) ret = ldb_add(wins_db, msg);113 if (ret != 0) goto failed;112 if (ret != LDB_SUCCESS) ret = ldb_add(wins_db, msg); 113 if (ret != LDB_SUCCESS) goto failed; 114 114 115 115 trans = ldb_transaction_commit(wins_db); … … 260 260 } 261 261 262 *p = '\0'; p++;262 *p = '\0'; p++; 263 263 addr->address = talloc_strdup(addr, address); 264 264 if (!addr->address) { … … 320 320 const char *attr_name, struct winsdb_addr *addr) 321 321 { 322 struct ldb_val val;323 322 const char *str; 324 323 325 324 if (rec->is_static) { 326 325 str = talloc_strdup(msg, addr->address); 327 if (!str) return -1;326 if (!str) return LDB_ERR_OPERATIONS_ERROR; 328 327 } else { 329 328 char *expire_time; 330 329 expire_time = ldb_timestring(msg, addr->expire_time); 331 if (!expire_time) return -1;330 if (!expire_time) return LDB_ERR_OPERATIONS_ERROR; 332 331 str = talloc_asprintf(msg, "%s;winsOwner:%s;expireTime:%s;", 333 332 addr->address, addr->wins_owner, 334 333 expire_time); 335 334 talloc_free(expire_time); 336 if (!str) return -1; 337 } 338 339 val.data = discard_const_p(uint8_t, str); 340 val.length = strlen(str); 341 342 return ldb_msg_add_value(msg, attr_name, &val, NULL); 335 if (!str) return LDB_ERR_OPERATIONS_ERROR; 336 } 337 338 return ldb_msg_add_string(msg, attr_name, str); 343 339 } 344 340 … … 508 504 addresses[len+1] = NULL; 509 505 510 ldb_qsort(addresses, len+1 , sizeof(addresses[0]), h, (ldb_qsort_cmp_fn_t)winsdb_addr_sort_list);506 LDB_TYPESAFE_QSORT(addresses, len+1, h, winsdb_addr_sort_list); 511 507 512 508 return addresses; … … 751 747 TALLOC_CTX *mem_ctx) 752 748 { 753 int i, ret =0;749 int i, ret; 754 750 size_t addr_count; 755 751 const char *expire_time; … … 773 769 msg->dn = winsdb_dn(msg, ldb, rec->name); 774 770 if (msg->dn == NULL) goto failed; 775 ret |= ldb_msg_add_fmt(msg, "type", "0x%02X", rec->name->type);771 ret = ldb_msg_add_fmt(msg, "type", "0x%02X", rec->name->type); 776 772 if (rec->name->name && *rec->name->name) { 777 773 ret |= ldb_msg_add_string(msg, "name", rec->name->name); … … 795 791 ret |= ldb_msg_add_winsdb_addr(msg, rec, "address", rec->addresses[i]); 796 792 } 797 ret |= ldb_msg_add_empty(msg, "registeredBy", 0, NULL);798 793 if (rec->registered_by) { 794 ret |= ldb_msg_add_empty(msg, "registeredBy", 0, NULL); 799 795 ret |= ldb_msg_add_string(msg, "registeredBy", rec->registered_by); 800 if (ret != 0) goto failed;801 }796 } 797 if (ret != LDB_SUCCESS) goto failed; 802 798 return msg; 803 799 … … 816 812 TALLOC_CTX *tmp_ctx = talloc_new(wins_db); 817 813 int trans = -1; 818 int ret = 0;814 int ret; 819 815 820 816 trans = ldb_transaction_start(wins_db); … … 833 829 if (msg == NULL) goto failed; 834 830 ret = ldb_add(wins_db, msg); 835 if (ret != 0) goto failed;831 if (ret != LDB_SUCCESS) goto failed; 836 832 837 833 trans = ldb_transaction_commit(wins_db); … … 860 856 int trans; 861 857 int ret; 862 int i;858 unsigned int i; 863 859 864 860 trans = ldb_transaction_start(wins_db); … … 882 878 883 879 ret = ldb_modify(wins_db, msg); 884 if (ret != 0) goto failed;880 if (ret != LDB_SUCCESS) goto failed; 885 881 886 882 trans = ldb_transaction_commit(wins_db); … … 917 913 918 914 ret = ldb_delete(wins_db, dn); 919 if (ret != 0) goto failed;915 if (ret != LDB_SUCCESS) goto failed; 920 916 921 917 trans = ldb_transaction_commit(wins_db); … … 963 959 964 960 ret = ldb_msg_add_string(msg, "@LIST", "wins_ldb"); 965 if (ret != 0) goto failed;961 if (ret != LDB_SUCCESS) goto failed; 966 962 967 963 ret = ldb_add(h->ldb, msg); 968 if (ret != 0) goto failed;964 if (ret != LDB_SUCCESS) goto failed; 969 965 970 966 trans = ldb_transaction_commit(h->ldb); … … 976 972 h->ldb = NULL; 977 973 978 if (lp _parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {974 if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { 979 975 flags |= LDB_FLG_NOSYNC; 980 976 } 981 977 982 h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp _wins_url(lp_ctx)),983 NULL, NULL, flags , NULL);978 h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)), 979 NULL, NULL, flags); 984 980 if (!h->ldb) goto failed; 985 981 … … 1012 1008 if (!h) return NULL; 1013 1009 1014 if (lp _parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {1010 if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { 1015 1011 flags |= LDB_FLG_NOSYNC; 1016 1012 } 1017 1013 1018 h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp _wins_url(lp_ctx)),1019 NULL, NULL, flags , NULL);1020 if (!h->ldb) goto failed; 1014 h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)), 1015 NULL, NULL, flags); 1016 if (!h->ldb) goto failed; 1021 1017 1022 1018 h->caller = caller; 1023 h->hook_script = lp _wins_hook(lp_ctx);1019 h->hook_script = lpcfg_wins_hook(lp_ctx); 1024 1020 1025 1021 h->local_owner = talloc_strdup(h, owner); … … 1038 1034 return NULL; 1039 1035 } 1036 -
trunk/server/source4/nbt_server/wins/winsserver.c
r414 r745 33 33 #include "lib/socket/socket.h" 34 34 #include "lib/socket/netif.h" 35 #include "lib/ldb/include/ldb.h"35 #include <ldb.h> 36 36 #include "param/param.h" 37 37 #include "libcli/resolve/resolve.h" 38 #include "lib/util/util_net.h" 38 39 39 40 /* … … 282 283 283 284 /* 284 * now remove all addresses that 'rethe client doesn't hold anymore285 * and update the time stamp and owner for the o wnes that are still there285 * now remove all addresses that the client doesn't hold anymore 286 * and update the time stamp and owner for the ones that are still there 286 287 */ 287 288 for (i=0; rec->addresses[i]; i++) { … … 415 416 416 417 s->io.in.nbtd_server = iface->nbtsrv; 417 s->io.in.nbt_port = lp _nbt_port(iface->nbtsrv->task->lp_ctx);418 s->io.in.nbt_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); 418 419 s->io.in.event_ctx = iface->nbtsrv->task->event_ctx; 419 420 s->io.in.name = rec->name; … … 497 498 } 498 499 500 if (name->scope && strlen(name->scope) > 237) { 501 rcode = NBT_RCODE_SVR; 502 goto done; 503 } 504 499 505 duplicate_packet = wins_check_wack_queue(iface, packet, src); 500 506 if (duplicate_packet) { … … 665 671 666 672 /* first sort the addresses depending on the matching to the client */ 667 ldb_qsort(addresses, num_addrs , sizeof(addresses[0]), 668 src, (ldb_qsort_cmp_fn_t)nbtd_wins_randomize1Clist_sort); 669 670 mask = lp_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask"); 673 LDB_TYPESAFE_QSORT(addresses, num_addrs, src, nbtd_wins_randomize1Clist_sort); 674 675 mask = lpcfg_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask"); 671 676 if (!mask) { 672 677 mask = "255.255.255.0"; … … 746 751 */ 747 752 if (name->type == NBT_NAME_LOGON && 748 lp _parm_bool(lp_ctx, NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) {753 lpcfg_parm_bool(lp_ctx, NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) { 749 754 struct nbt_name name_1b; 750 755 … … 760 765 status = winsdb_lookup(winssrv->wins_db, name, packet, &rec); 761 766 if (!NT_STATUS_IS_OK(status)) { 762 if (!lp _wins_dns_proxy(lp_ctx)) {767 if (!lpcfg_wins_dns_proxy(lp_ctx)) { 763 768 goto notfound; 764 769 } … … 842 847 */ 843 848 if (name->type == NBT_NAME_LOGON && 844 lp _parm_bool(lp_ctx, NULL, "nbtd", "wins_randomize1Clist", false)) {849 lpcfg_parm_bool(lp_ctx, NULL, "nbtd", "wins_randomize1Clist", false)) { 845 850 nbtd_wins_randomize1Clist(lp_ctx, addresses, src); 846 851 } … … 872 877 873 878 if (name->type == NBT_NAME_MASTER) { 879 goto done; 880 } 881 882 if (name->scope && strlen(name->scope) > 237) { 874 883 goto done; 875 884 } … … 951 960 modify_flags = WINSDB_FLAG_ALLOC_VERSION | WINSDB_FLAG_TAKE_OWNERSHIP; 952 961 } 953 if (lp _parm_bool(iface->nbtsrv->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false)) {962 if (lpcfg_parm_bool(iface->nbtsrv->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false)) { 954 963 /* 955 964 * We have an option to propagate every name release, … … 1030 1039 const char *owner; 1031 1040 1032 if (!lp _wins_support(nbtsrv->task->lp_ctx)) {1041 if (!lpcfg_wins_support(nbtsrv->task->lp_ctx)) { 1033 1042 nbtsrv->winssrv = NULL; 1034 1043 return NT_STATUS_OK; … … 1038 1047 NT_STATUS_HAVE_NO_MEMORY(nbtsrv->winssrv); 1039 1048 1040 nbtsrv->winssrv->config.max_renew_interval = lp _max_wins_ttl(nbtsrv->task->lp_ctx);1041 nbtsrv->winssrv->config.min_renew_interval = lp _min_wins_ttl(nbtsrv->task->lp_ctx);1042 tmp = lp _parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);1049 nbtsrv->winssrv->config.max_renew_interval = lpcfg_max_wins_ttl(nbtsrv->task->lp_ctx); 1050 nbtsrv->winssrv->config.min_renew_interval = lpcfg_min_wins_ttl(nbtsrv->task->lp_ctx); 1051 tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60); 1043 1052 nbtsrv->winssrv->config.tombstone_interval = tmp; 1044 tmp = lp _parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60);1053 tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60); 1045 1054 nbtsrv->winssrv->config.tombstone_timeout = tmp; 1046 1055 1047 owner = lp _parm_string(nbtsrv->task->lp_ctx, NULL, "winsdb", "local_owner");1056 owner = lpcfg_parm_string(nbtsrv->task->lp_ctx, NULL, "winsdb", "local_owner"); 1048 1057 1049 1058 if (owner == NULL) { 1050 1059 struct interface *ifaces; 1051 load_interfaces(nbtsrv->task, lp _interfaces(nbtsrv->task->lp_ctx), &ifaces);1060 load_interfaces(nbtsrv->task, lpcfg_interfaces(nbtsrv->task->lp_ctx), &ifaces); 1052 1061 owner = iface_n_ip(ifaces, 0); 1053 1062 } -
trunk/server/source4/nbt_server/wins/winsserver.h
r414 r745 64 64 }; 65 65 66 struct composite_context; 66 67 #include "nbt_server/wins/winsserver_proto.h" -
trunk/server/source4/nbt_server/wins/winswack.c
r414 r745 164 164 struct nbtd_interface *iface; 165 165 166 state->release.in.dest_port = lp _nbt_port(state->io->in.nbtd_server->task->lp_ctx);166 state->release.in.dest_port = lpcfg_nbt_port(state->io->in.nbtd_server->task->lp_ctx); 167 167 state->release.in.dest_addr = state->io->in.addresses[state->current_address]; 168 168 state->release.in.address = state->release.in.dest_addr; … … 224 224 */ 225 225 state->release.in.name = *state->io->in.name; 226 state->release.in.dest_port = lp _nbt_port(state->io->in.nbtd_server->task->lp_ctx);226 state->release.in.dest_port = lpcfg_nbt_port(state->io->in.nbtd_server->task->lp_ctx); 227 227 state->release.in.dest_addr = state->io->in.addresses[state->current_address]; 228 228 state->release.in.address = state->release.in.dest_addr; … … 307 307 308 308 s->io.in.nbtd_server = nbtd_server; 309 s->io.in.nbt_port = lp _nbt_port(nbtd_server->task->lp_ctx);309 s->io.in.nbt_port = lpcfg_nbt_port(nbtd_server->task->lp_ctx); 310 310 s->io.in.event_ctx = msg->ev; 311 311 s->io.in.name = &req->in.name;
Note:
See TracChangeset
for help on using the changeset viewer.