{"bigendian", DCERPC_PUSH_BIGENDIAN},
{"smb2", DCERPC_SMB2},
{"ndr64", DCERPC_NDR64},
- {"localaddress", DCERPC_LOCALADDRESS}
};
const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
}
o = s;
- if (ncacn_options[i].flag == DCERPC_LOCALADDRESS && b->localaddress) {
- s = talloc_asprintf_append_buffer(s, ",%s=%s", ncacn_options[i].name,
- b->localaddress);
- } else {
- s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name);
- }
+ s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name);
if (s == NULL) {
talloc_free(o);
return NULL;
b->flags = 0;
b->assoc_group_id = 0;
b->endpoint = NULL;
- b->localaddress = NULL;
if (!options) {
*b_out = b;
int k;
char c = b->options[i][opt_len];
- if (ncacn_options[j].flag == DCERPC_LOCALADDRESS && c == '=') {
- b->localaddress = talloc_strdup(b, &b->options[i][opt_len+1]);
- } else if (c != 0) {
+ if (c != 0) {
continue;
}
size_t i;
int ret;
- ret = strcmp(name, "localaddress");
- if (ret == 0) {
- return b->localaddress;
- }
-
if (b->options == NULL) {
return NULL;
}
* value != NULL means add or reset.
*/
- ret = strcmp(name, "localaddress");
- if (ret == 0) {
- tmp = discard_const_p(char, b->localaddress);
-
- if (value == NULL) {
- talloc_free(tmp);
- b->localaddress = NULL;
- b->flags &= ~DCERPC_LOCALADDRESS;
- return NT_STATUS_OK;
- }
-
- b->localaddress = talloc_strdup(b, value);
- if (b->localaddress == NULL) {
- b->localaddress = tmp;
- return NT_STATUS_NO_MEMORY;
- }
- talloc_free(tmp);
-
- b->flags |= DCERPC_LOCALADDRESS;
- return NT_STATUS_OK;
- }
-
for (i=0; b->options && b->options[i]; i++) {
const char *o = b->options[i];
}
}
- if (b->localaddress != NULL) {
- n->localaddress = talloc_strdup(n, b->localaddress);
- if (n->localaddress == NULL) {
- talloc_free(n);
- return NULL;
- }
- }
-
if (b->endpoint != NULL) {
n->endpoint = talloc_strdup(n, b->endpoint);
if (n->endpoint == NULL) {
const char *target_principal;
const char *endpoint;
const char **options;
- const char *localaddress;
uint32_t flags;
uint32_t assoc_group_id;
};
/* use NDR64 transport */
#define DCERPC_NDR64 (1<<21)
-/* specify binding interface */
-#define DCERPC_LOCALADDRESS (1<<22)
-
/* handle upgrades or downgrades automatically */
#define DCERPC_SCHANNEL_AUTO (1<<23)
"308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$SERVER", &b), "parse");
torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_ip_tcp:$SERVER[,sign,localaddress=192.168.1.1]", &b), "parse");
torture_assert(tctx, b->transport == NCACN_IP_TCP, "ncacn_ip_tcp expected");
- torture_assert(tctx, b->flags == (DCERPC_SIGN | DCERPC_LOCALADDRESS), "sign flag");
- torture_assert_str_equal(tctx, b->localaddress, "192.168.1.1", "localaddress");
+ torture_assert(tctx, b->flags == DCERPC_SIGN, "sign flag");
+ torture_assert_str_equal(tctx, dcerpc_binding_get_string_option(b, "localaddress"),
+ "192.168.1.1", "localaddress");
torture_assert_str_equal(tctx, "ncacn_ip_tcp:$SERVER[,sign,localaddress=192.168.1.1]",
dcerpc_binding_string(tctx, b), "back to string");