diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-10-11 20:12:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:48 -0500 |
commit | e2d27b9d238bd2cbf104237934db11e980977a0e (patch) | |
tree | 74887afea0e056c11fd7d6c14d2c978e631b0488 | |
parent | 8e1ffff226e3016a38301a773ed8aa55bad5b710 (diff) | |
download | samba-e2d27b9d238bd2cbf104237934db11e980977a0e.tar.gz samba-e2d27b9d238bd2cbf104237934db11e980977a0e.tar.bz2 samba-e2d27b9d238bd2cbf104237934db11e980977a0e.zip |
r2921: Add a few more protocols and fix the numbers associated with some of
the current ones. It took me three hours to realise that the DCOM standard
contains false protocol numbers (apparently someone converted the protocol
numbers to hex twice, i.e. 13 -> 0c and 14 to 0d). There are no longer
duplicates in the list with protocol numbers now.
(This used to be commit f355cd426462a72575ef3c3b769f676334976986)
-rw-r--r-- | source4/librpc/idl/dcerpc.idl | 1 | ||||
-rw-r--r-- | source4/librpc/idl/epmapper.idl | 43 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 6 | ||||
-rw-r--r-- | source4/rpc_server/epmapper/rpc_epmapper.c | 20 | ||||
-rw-r--r-- | source4/torture/rpc/epmapper.c | 60 |
5 files changed, 76 insertions, 54 deletions
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl index 191e10a17a..81571541ea 100644 --- a/source4/librpc/idl/dcerpc.idl +++ b/source4/librpc/idl/dcerpc.idl @@ -110,6 +110,7 @@ interface dcerpc */ const uint8 DCERPC_AUTH_TYPE_KRB5_16 = 16; const uint8 DCERPC_AUTH_TYPE_SCHANNEL = 68; + const uint8 DCERPC_AUTH_TYPE_MSMQ = 100; const uint8 DCERPC_AUTH_LEVEL_NONE = 1; const uint8 DCERPC_AUTH_LEVEL_CONNECT = 2; diff --git a/source4/librpc/idl/epmapper.idl b/source4/librpc/idl/epmapper.idl index 6a58dcfd7a..80c2fe5ee0 100644 --- a/source4/librpc/idl/epmapper.idl +++ b/source4/librpc/idl/epmapper.idl @@ -42,26 +42,35 @@ interface epmapper } epm_prot_uuid; typedef enum { - EPM_PROTOCOL_NCACN_DNET_NSP = 0x04, - EPM_PROTOCOL_NCACN_OSI_TP4 = 0x05, - EPM_PROTOCOL_NCACN_OSI_CLNS = 0x06, - EPM_PROTOCOL_NCACN_TCP = 0x07, - EPM_PROTOCOL_NCADG_UDP = 0x08, - EPM_PROTOCOL_NCACN_IP = 0x09, - EPM_PROTOCOL_NCADG_RPC = 0x0a, /* Connectionless RPC */ - EPM_PROTOCOL_NCACN_RPC_C = 0x0b, - EPM_PROTOCOL_NCACN_SPX = 0x0c, - EPM_PROTOCOL_UUID = 0x0d, - EPM_PROTOCOL_NCADG_IPX = 0x0e, - EPM_PROTOCOL_NCACN_SMB = 0x0f, - EPM_PROTOCOL_NCACN_PIPE = 0x10, - EPM_PROTOCOL_NCACN_NETBIOS = 0x11, - EPM_PROTOCOL_NCACN_NB_NB = 0x12, /* NetBIOS over NetBEUI */ - EPM_PROTOCOL_NCACN_HTTP = 0x1f + + /* Level 4 and higher */ + EPM_PROTOCOL_DNET_NSP = 0x04, + EPM_PROTOCOL_OSI_TP4 = 0x05, + EPM_PROTOCOL_OSI_CLNS = 0x06, + EPM_PROTOCOL_TCP = 0x07, + EPM_PROTOCOL_UDP = 0x08, + EPM_PROTOCOL_IP = 0x09, + + /* These 4 are protocol identifiers, always at level 3 or lower */ + EPM_PROTOCOL_NCADG = 0x0a, /* Connectionless RPC */ + EPM_PROTOCOL_NCACN = 0x0b, + EPM_PROTOCOL_NCALRPC = 0x0c, /* Local RPC */ + EPM_PROTOCOL_UUID = 0x0d, + + EPM_PROTOCOL_IPX = 0x0e, + EPM_PROTOCOL_SMB = 0x0f, + EPM_PROTOCOL_PIPE = 0x10, + EPM_PROTOCOL_NETBIOS = 0x11, + EPM_PROTOCOL_NB_NB = 0x12, /* NetBIOS over NetBEUI */ + EPM_PROTOCOL_SPX = 0x13, + EPM_PROTOCOL_NB_IPX = 0x14, /* NetBIOS over IPX */ + EPM_PROTOCOL_HTTP = 0x1f, + EPM_PROTOCOL_UNIX_DS = 0x20, /* Unix domain socket */ + EPM_PROTOCOL_NULL = 0x21 } epm_protocols; typedef [nodiscriminant] union { - [case(13)] epm_prot_uuid uuid; + [case(EPM_PROTOCOL_UUID)] epm_prot_uuid uuid; [default] [flag(NDR_REMAINING)] DATA_BLOB lhs_data; } epm_protocol_info; diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index f2ba573369..d3c461a2f4 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -105,17 +105,17 @@ NTSTATUS dcerpc_epm_map_tcp_port(const char *server, twr.towers.floors[1].rhs.rhs_data = data_blob_talloc_zero(p, 2); /* on an RPC connection ... */ - twr.towers.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN_RPC_C; + twr.towers.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN; twr.towers.floors[2].lhs.info.lhs_data = data_blob(NULL, 0); twr.towers.floors[2].rhs.rhs_data = data_blob_talloc_zero(p, 2); /* on a TCP port ... */ - twr.towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_TCP; + twr.towers.floors[3].lhs.protocol = EPM_PROTOCOL_TCP; twr.towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr.towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p, 2); /* on an IP link ... */ - twr.towers.floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_IP; + twr.towers.floors[4].lhs.protocol = EPM_PROTOCOL_IP; twr.towers.floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr.towers.floors[4].rhs.rhs_data = data_blob_talloc_zero(p, 4); diff --git a/source4/rpc_server/epmapper/rpc_epmapper.c b/source4/rpc_server/epmapper/rpc_epmapper.c index 54a996e82a..5f9271868c 100644 --- a/source4/rpc_server/epmapper/rpc_epmapper.c +++ b/source4/rpc_server/epmapper/rpc_epmapper.c @@ -72,21 +72,21 @@ static BOOL fill_protocol_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr, twr->floors[1].rhs.rhs_data = data_blob_talloc_zero(mem_ctx, 2); /* on an RPC connection ... */ - twr->floors[2].lhs.protocol = EPM_PROTOCOL_NCACN_RPC_C; + twr->floors[2].lhs.protocol = EPM_PROTOCOL_NCACN; twr->floors[2].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[2].rhs.rhs_data = data_blob_talloc_zero(mem_ctx, 2); switch (e->ep_description.type) { case ENDPOINT_SMB: /* on a SMB pipe ... */ - twr->floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_SMB; + twr->floors[3].lhs.protocol = EPM_PROTOCOL_SMB; twr->floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[3].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\PIPE\\%s", e->ep_description.info.smb_pipe); twr->floors[3].rhs.rhs_data.length = strlen(twr->floors[3].rhs.rhs_data.data)+1; /* on an NetBIOS link ... */ - twr->floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_NETBIOS; + twr->floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS; twr->floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[4].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name()); @@ -95,13 +95,13 @@ static BOOL fill_protocol_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr, case ENDPOINT_TCP: /* on a TCP connection ... */ - twr->floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_TCP; + twr->floors[3].lhs.protocol = EPM_PROTOCOL_TCP; twr->floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[3].rhs.rhs_data = data_blob_talloc(mem_ctx, NULL, 2); RSSVAL(twr->floors[3].rhs.rhs_data.data, 0, e->ep_description.info.tcp_port); /* on an IP link ... */ - twr->floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_IP; + twr->floors[4].lhs.protocol = EPM_PROTOCOL_IP; twr->floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[4].rhs.rhs_data = data_blob_talloc_zero(mem_ctx, 4); /* TODO: we should fill in our IP address here as a hint to the @@ -270,7 +270,7 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me floors[1].lhs.protocol != EPM_PROTOCOL_UUID || guid_cmp(mem_ctx, &floors[1].lhs.info.uuid.uuid, NDR_GUID) != 0 || floors[1].lhs.info.uuid.version != NDR_GUID_VERSION || - floors[2].lhs.protocol != EPM_PROTOCOL_NCACN_RPC_C) { + floors[2].lhs.protocol != EPM_PROTOCOL_NCACN) { goto failed; } @@ -281,14 +281,14 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me } switch (eps[i].ep_description.type) { case ENDPOINT_SMB: - if (floors[3].lhs.protocol != EPM_PROTOCOL_NCACN_SMB || - floors[4].lhs.protocol != EPM_PROTOCOL_NCACN_NETBIOS) { + if (floors[3].lhs.protocol != EPM_PROTOCOL_SMB || + floors[4].lhs.protocol != EPM_PROTOCOL_NETBIOS) { continue; } break; case ENDPOINT_TCP: - if (floors[3].lhs.protocol != EPM_PROTOCOL_NCACN_TCP || - floors[4].lhs.protocol != EPM_PROTOCOL_NCACN_IP) { + if (floors[3].lhs.protocol != EPM_PROTOCOL_TCP || + floors[4].lhs.protocol != EPM_PROTOCOL_IP) { continue; } break; diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c index 6a50d18276..ebb640b70d 100644 --- a/source4/torture/rpc/epmapper.c +++ b/source4/torture/rpc/epmapper.c @@ -33,11 +33,8 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) for (i=0;i<twr->num_floors;i++) { struct epm_lhs *lhs = &twr->floors[i].lhs; struct epm_rhs *rhs = &twr->floors[i].rhs; - switch (lhs->protocol) { - case EPM_PROTOCOL_NCACN_DNET_NSP: - printf(" DNET/NSP"); - break; - + + switch(lhs->protocol) { case EPM_PROTOCOL_UUID: uuid = GUID_string(mem_ctx, &lhs->info.uuid.uuid); if (strcasecmp(uuid, NDR_GUID) == 0) { @@ -47,11 +44,23 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) } break; - case EPM_PROTOCOL_NCACN_RPC_C: + case EPM_PROTOCOL_NCACN: printf(" RPC-C"); break; - case EPM_PROTOCOL_NCACN_IP: + case EPM_PROTOCOL_NCADG: + printf(" RPC"); + break; + + case EPM_PROTOCOL_NCALRPC: + printf(" NCALRPC"); + break; + + case EPM_PROTOCOL_DNET_NSP: + printf(" DNET/NSP"); + break; + + case EPM_PROTOCOL_IP: printf(" IP:"); if (rhs->rhs_data.length == 4) { struct in_addr in; @@ -60,43 +69,46 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) } break; - case EPM_PROTOCOL_NCACN_PIPE: + case EPM_PROTOCOL_PIPE: printf(" PIPE:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_NCACN_SMB: + case EPM_PROTOCOL_SMB: printf(" SMB:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_NCACN_NETBIOS: + case EPM_PROTOCOL_UNIX_DS: + printf(" Unix Domain Socket:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); + break; + + case EPM_PROTOCOL_NETBIOS: printf(" NetBIOS:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_NCACN_NB_NB: + case EPM_PROTOCOL_NB_NB: printf(" NB_NB"); break; - case EPM_PROTOCOL_NCACN_SPX: + case EPM_PROTOCOL_SPX: printf(" SPX"); break; - /* - case EPM_PROTOCOL_NCACN_NB_IPX: + case EPM_PROTOCOL_NB_IPX: printf(" NB_IPX"); - break;*/ + break; case 0x01: printf(" UNK(1):%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_NCACN_HTTP: + case EPM_PROTOCOL_HTTP: printf(" HTTP:"); if (rhs->rhs_data.length == 2) { printf("%d", RSVAL(rhs->rhs_data.data, 0)); } break; - case EPM_PROTOCOL_NCACN_TCP: + case EPM_PROTOCOL_TCP: /* what is the difference between this and 0x1f? */ printf(" TCP:"); if (rhs->rhs_data.length == 2) { @@ -104,7 +116,7 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) } break; - case EPM_PROTOCOL_NCADG_UDP: + case EPM_PROTOCOL_UDP: printf(" UDP:"); break; @@ -149,15 +161,15 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("epm_Map results for '%s':\n", idl_pipe_name(uuid_str, twr->towers.floors[0].lhs.info.uuid.version)); - twr->towers.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN_RPC_C; + twr->towers.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN; twr->towers.floors[2].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[2].rhs.rhs_data = data_blob_talloc_zero(p, 2); - twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_TCP; + twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_TCP; twr->towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p, 2); - twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_IP; + twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_IP; twr->towers.floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[4].rhs.rhs_data = data_blob_talloc_zero(p, 4); @@ -170,7 +182,7 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } } - twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_HTTP; + twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_HTTP; twr->towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p, 2); @@ -183,11 +195,11 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } } - twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_SMB; + twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_SMB; twr->towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p, 2); - twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_NETBIOS; + twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS; twr->towers.floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[4].rhs.rhs_data = data_blob_talloc_zero(p, 2); |