#
# patch "ChangeLog"
# from [50ec104f400f556a46bae530d9cecd9cdd85140d]
# to [e409db4226f556e3226bf172fbe9749b4cb38c17]
#
# patch "netcmd.cc"
# from [7308c12cecebbd725ddca9ebfa94bd9a6e1efdea]
# to [e267e539b35fdb9b5ad72b330773d0e92ea485f3]
#
# patch "netcmd.hh"
# from [db259c3bbd1fdc984b3cae3fb90128f7b0e461e5]
# to [6054b45890695d2e78404a82f9f2bc6b85ca8330]
#
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,11 @@
2005-06-28 Nathaniel Smith
+ * netcmd.{cc,hh} (read_anonymous_cmd, write_anonymous_cmd)
+ (read_auth_cmd, write_auth_cmd): Take include_pattern and
+ exclude_pattern arguments.
+
+2005-06-28 Nathaniel Smith
+
* globish.{cc,hh}: New files.
* Makefile.am (MOST_SOURCES): Add them.
* transforms.{cc,hh}: Remove glob-related stuff.
--- netcmd.cc
+++ netcmd.cc
@@ -241,19 +241,25 @@
void
netcmd::read_anonymous_cmd(protocol_role & role,
- std::string & pattern,
+ utf8 & include_pattern,
+ utf8 & exclude_pattern,
rsa_oaep_sha_data & hmac_key_encrypted) const
{
size_t pos = 0;
- // syntax is:
+ // syntax is:
u8 role_byte = extract_datum_lsb(payload, pos, "anonymous(hmac) netcmd, role");
if (role_byte != static_cast(source_role)
&& role_byte != static_cast(sink_role)
&& role_byte != static_cast(source_and_sink_role))
throw bad_decode(F("unknown role specifier %d") % widen(role_byte));
role = static_cast(role_byte);
- extract_variable_length_string(payload, pattern, pos,
- "anonymous(hmac) netcmd, pattern");
+ std::string pattern_string;
+ extract_variable_length_string(payload, pattern_string, pos,
+ "anonymous(hmac) netcmd, include_pattern");
+ include_pattern = utf8(pattern_string);
+ extract_variable_length_string(payload, pattern_string, pos,
+ "anonymous(hmac) netcmd, exclude_pattern");
+ exclude_pattern = utf8(pattern_string);
string hmac_key_string;
extract_variable_length_string(payload, hmac_key_string, pos,
"anonymous(hmac) netcmd, hmac_key_encrypted");
@@ -263,25 +269,28 @@
void
netcmd::write_anonymous_cmd(protocol_role role,
- std::string const & pattern,
+ utf8 const & include_pattern,
+ utf8 const & exclude_pattern,
rsa_oaep_sha_data const & hmac_key_encrypted)
{
cmd_code = anonymous_cmd;
payload = static_cast(role);
- insert_variable_length_string(pattern, payload);
+ insert_variable_length_string(include_pattern(), payload);
+ insert_variable_length_string(exclude_pattern(), payload);
insert_variable_length_string(hmac_key_encrypted(), payload);
}
void
netcmd::read_auth_cmd(protocol_role & role,
- string & pattern,
+ utf8 & include_pattern,
+ utf8 & exclude_pattern,
id & client,
id & nonce1,
rsa_oaep_sha_data & hmac_key_encrypted,
string & signature) const
{
size_t pos = 0;
- // syntax is:
+ // syntax is:
//
//
u8 role_byte = extract_datum_lsb(payload, pos, "auth netcmd, role");
@@ -290,7 +299,13 @@
&& role_byte != static_cast(source_and_sink_role))
throw bad_decode(F("unknown role specifier %d") % widen(role_byte));
role = static_cast(role_byte);
- extract_variable_length_string(payload, pattern, pos, "auth(hmac) netcmd, pattern");
+ std::string pattern_string;
+ extract_variable_length_string(payload, pattern_string, pos,
+ "auth(hmac) netcmd, include_pattern");
+ include_pattern = utf8(pattern_string);
+ extract_variable_length_string(payload, pattern_string, pos,
+ "auth(hmac) netcmd, exclude_pattern");
+ exclude_pattern = utf8(pattern_string);
client = id(extract_substring(payload, pos,
constants::merkle_hash_length_in_bytes,
"auth(hmac) netcmd, client identifier"));
@@ -308,7 +323,8 @@
void
netcmd::write_auth_cmd(protocol_role role,
- string const & pattern,
+ utf8 const & include_pattern,
+ utf8 const & exclude_pattern,
id const & client,
id const & nonce1,
rsa_oaep_sha_data const & hmac_key_encrypted,
@@ -318,7 +334,8 @@
I(client().size() == constants::merkle_hash_length_in_bytes);
I(nonce1().size() == constants::merkle_hash_length_in_bytes);
payload = static_cast(role);
- insert_variable_length_string(pattern, payload);
+ insert_variable_length_string(include_pattern(), payload);
+ insert_variable_length_string(exclude_pattern(), payload);
payload += client();
payload += nonce1();
insert_variable_length_string(hmac_key_encrypted(), payload);
--- netcmd.hh
+++ netcmd.hh
@@ -83,20 +83,24 @@
id const & nonce);
void read_anonymous_cmd(protocol_role & role,
- std::string & pattern,
+ utf8 & include_pattern,
+ utf8 & exclude_pattern,
rsa_oaep_sha_data & hmac_key_encrypted) const;
void write_anonymous_cmd(protocol_role role,
- std::string const & pattern,
+ utf8 const & include_pattern,
+ utf8 const & exclude_pattern,
rsa_oaep_sha_data const & hmac_key_encrypted);
void read_auth_cmd(protocol_role & role,
- std::string & pattern,
+ utf8 & include_pattern,
+ utf8 & exclude_pattern,
id & client,
id & nonce1,
rsa_oaep_sha_data & hmac_key_encrypted,
std::string & signature) const;
void write_auth_cmd(protocol_role role,
- std::string const & pattern,
+ utf8 const & include_pattern,
+ utf8 const & exclude_pattern,
id const & client,
id const & nonce1,
rsa_oaep_sha_data const & hmac_key_encrypted,