| 989 | | |
| 990 | | /* BMI_tcp_post_send() |
| 991 | | * |
| 992 | | * Submits send operations. |
| 993 | | * |
| 994 | | * returns 0 on success that requires later poll, returns 1 on instant |
| 995 | | * completion, -errno on failure |
| 996 | | */ |
| 997 | | int BMI_tcp_post_send(bmi_op_id_t * id, |
| 998 | | bmi_method_addr_p dest, |
| 999 | | const void *buffer, |
| 1000 | | bmi_size_t size, |
| 1001 | | enum bmi_buffer_type buffer_type, |
| 1002 | | bmi_msg_tag_t tag, |
| 1003 | | void *user_ptr, |
| 1004 | | bmi_context_id context_id, |
| 1005 | | PVFS_hint hints) |
| 1006 | | { |
| 1007 | | struct tcp_msg_header my_header; |
| 1008 | | int ret = -1; |
| 1009 | | |
| 1010 | | /* clear the id field for safety */ |
| 1011 | | *id = 0; |
| 1012 | | |
| 1013 | | /* fill in the TCP-specific message header */ |
| 1014 | | if (size > TCP_MODE_REND_LIMIT) |
| 1015 | | { |
| 1016 | | return (bmi_tcp_errno_to_pvfs(-EMSGSIZE)); |
| 1017 | | } |
| 1018 | | |
| 1019 | | if (size <= TCP_MODE_EAGER_LIMIT) |
| 1020 | | { |
| 1021 | | my_header.mode = TCP_MODE_EAGER; |
| 1022 | | } |
| 1023 | | else |
| 1024 | | { |
| 1025 | | my_header.mode = TCP_MODE_REND; |
| 1026 | | } |
| 1027 | | my_header.tag = tag; |
| 1028 | | my_header.size = size; |
| 1029 | | my_header.magic_nr = BMI_MAGIC_NR; |
| 1030 | | |
| 1031 | | gen_mutex_lock(&interface_mutex); |
| 1032 | | |
| 1033 | | ret = tcp_post_send_generic(id, dest, &buffer, |
| 1034 | | &size, 1, buffer_type, my_header, |
| 1035 | | user_ptr, context_id, hints); |
| 1036 | | |
| 1037 | | gen_mutex_unlock(&interface_mutex); |
| 1038 | | return(ret); |
| 1039 | | } |
| 1040 | | |
| 1041 | | |
| 1042 | | /* BMI_tcp_post_sendunexpected() |
| 1043 | | * |
| 1044 | | * Submits unexpected send operations. |
| 1045 | | * |
| 1046 | | * returns 0 on success that requires later poll, returns 1 on instant |
| 1047 | | * completion, -errno on failure |
| 1048 | | */ |
| 1049 | | int BMI_tcp_post_sendunexpected(bmi_op_id_t * id, |
| 1050 | | bmi_method_addr_p dest, |
| 1051 | | const void *buffer, |
| 1052 | | bmi_size_t size, |
| 1053 | | enum bmi_buffer_type buffer_type, |
| 1054 | | bmi_msg_tag_t tag, |
| 1055 | | void *user_ptr, |
| 1056 | | bmi_context_id context_id, |
| 1057 | | PVFS_hint hints) |
| 1058 | | { |
| 1059 | | struct tcp_msg_header my_header; |
| 1060 | | int ret = -1; |
| 1061 | | |
| 1062 | | /* clear the id field for safety */ |
| 1063 | | *id = 0; |
| 1064 | | |
| 1065 | | if (size > TCP_MODE_EAGER_LIMIT) |
| 1066 | | { |
| 1067 | | return (bmi_tcp_errno_to_pvfs(-EMSGSIZE)); |
| 1068 | | } |
| 1069 | | |
| 1070 | | my_header.mode = TCP_MODE_UNEXP; |
| 1071 | | my_header.tag = tag; |
| 1072 | | my_header.size = size; |
| 1073 | | my_header.magic_nr = BMI_MAGIC_NR; |
| 1074 | | |
| 1075 | | gen_mutex_lock(&interface_mutex); |
| 1076 | | |
| 1077 | | ret = tcp_post_send_generic(id, dest, &buffer, |
| 1078 | | &size, 1, buffer_type, my_header, |
| 1079 | | user_ptr, context_id, hints); |
| 1080 | | gen_mutex_unlock(&interface_mutex); |
| 1081 | | return(ret); |
| 1082 | | } |
| 1083 | | |
| 1084 | | |
| 1085 | | |
| 1086 | | /* BMI_tcp_post_recv() |
| 1087 | | * |
| 1088 | | * Submits recv operations. |
| 1089 | | * |
| 1090 | | * returns 0 on success that requires later poll, returns 1 on instant |
| 1091 | | * completion, -errno on failure |
| 1092 | | */ |
| 1093 | | int BMI_tcp_post_recv(bmi_op_id_t * id, |
| 1094 | | bmi_method_addr_p src, |
| 1095 | | void *buffer, |
| 1096 | | bmi_size_t expected_size, |
| 1097 | | bmi_size_t * actual_size, |
| 1098 | | enum bmi_buffer_type buffer_type, |
| 1099 | | bmi_msg_tag_t tag, |
| 1100 | | void *user_ptr, |
| 1101 | | bmi_context_id context_id, |
| 1102 | | PVFS_hint hints) |
| 1103 | | { |
| 1104 | | int ret = -1; |
| 1105 | | |
| 1106 | | /* A few things could happen here: |
| 1107 | | * a) rendez. recv with sender not ready yet |
| 1108 | | * b) rendez. recv with sender waiting |
| 1109 | | * c) eager recv, data not available yet |
| 1110 | | * d) eager recv, some/all data already here |
| 1111 | | * e) rendez. recv with sender in eager mode |
| 1112 | | * |
| 1113 | | * b or d could lead to completion without polling. |
| 1114 | | * we don't look for unexpected messages here. |
| 1115 | | */ |
| 1116 | | |
| 1117 | | if (expected_size > TCP_MODE_REND_LIMIT) |
| 1118 | | { |
| 1119 | | return (bmi_tcp_errno_to_pvfs(-EINVAL)); |
| 1120 | | } |
| 1121 | | gen_mutex_lock(&interface_mutex); |
| 1122 | | |
| 1123 | | ret = tcp_post_recv_generic(id, src, &buffer, &expected_size, |
| 1124 | | 1, expected_size, actual_size, |
| 1125 | | buffer_type, tag, |
| 1126 | | user_ptr, context_id, hints); |
| 1127 | | |
| 1128 | | gen_mutex_unlock(&interface_mutex); |
| 1129 | | return (ret); |
| 1130 | | } |
| 1131 | | |
| 1132 | | |
| | 4083 | * My best guess at if you are big-endian or little-endian. This may |
| | 4084 | * need adjustment. |
| | 4085 | */ |
| | 4086 | #if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ |
| | 4087 | __BYTE_ORDER == __LITTLE_ENDIAN) || \ |
| | 4088 | (defined(i386) || defined(__i386__) || defined(__i486__) || \ |
| | 4089 | defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL)) |
| | 4090 | # define HASH_LITTLE_ENDIAN 1 |
| | 4091 | # define HASH_BIG_ENDIAN 0 |
| | 4092 | #elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ |
| | 4093 | __BYTE_ORDER == __BIG_ENDIAN) || \ |
| | 4094 | (defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel)) |
| | 4095 | # define HASH_LITTLE_ENDIAN 0 |
| | 4096 | # define HASH_BIG_ENDIAN 1 |
| | 4097 | #else |
| | 4098 | # define HASH_LITTLE_ENDIAN 0 |
| | 4099 | # define HASH_BIG_ENDIAN 0 |
| | 4100 | #endif |
| | 4101 | |
| | 4102 | #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) |
| | 4103 | |
| | 4104 | /* |
| | 4105 | ------------------------------------------------------------------------------- |
| | 4106 | mix -- mix 3 32-bit values reversibly. |
| | 4107 | |
| | 4108 | This is reversible, so any information in (a,b,c) before mix() is |
| | 4109 | still in (a,b,c) after mix(). |
| | 4110 | |
| | 4111 | If four pairs of (a,b,c) inputs are run through mix(), or through |
| | 4112 | mix() in reverse, there are at least 32 bits of the output that |
| | 4113 | are sometimes the same for one pair and different for another pair. |
| | 4114 | This was tested for: |
| | 4115 | * pairs that differed by one bit, by two bits, in any combination |
| | 4116 | of top bits of (a,b,c), or in any combination of bottom bits of |
| | 4117 | (a,b,c). |
| | 4118 | * "differ" is defined as +, -, ^, or ~^. For + and -, I transformed |
| | 4119 | the output delta to a Gray code (a^(a>>1)) so a string of 1's (as |
| | 4120 | is commonly produced by subtraction) look like a single 1-bit |
| | 4121 | difference. |
| | 4122 | * the base values were pseudorandom, all zero but one bit set, or |
| | 4123 | all zero plus a counter that starts at zero. |
| | 4124 | |
| | 4125 | Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that |
| | 4126 | satisfy this are |
| | 4127 | 4 6 8 16 19 4 |
| | 4128 | 9 15 3 18 27 15 |
| | 4129 | 14 9 3 7 17 3 |
| | 4130 | Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing |
| | 4131 | for "differ" defined as + with a one-bit base and a two-bit delta. I |
| | 4132 | used http://burtleburtle.net/bob/hash/avalanche.html to choose |
| | 4133 | the operations, constants, and arrangements of the variables. |
| | 4134 | |
| | 4135 | This does not achieve avalanche. There are input bits of (a,b,c) |
| | 4136 | that fail to affect some output bits of (a,b,c), especially of a. The |
| | 4137 | most thoroughly mixed value is c, but it doesn't really even achieve |
| | 4138 | avalanche in c. |
| | 4139 | |
| | 4140 | This allows some parallelism. Read-after-writes are good at doubling |
| | 4141 | the number of bits affected, so the goal of mixing pulls in the opposite |
| | 4142 | direction as the goal of parallelism. I did what I could. Rotates |
| | 4143 | seem to cost as much as shifts on every machine I could lay my hands |
| | 4144 | on, and rotates are much kinder to the top and bottom bits, so I used |
| | 4145 | rotates. |
| | 4146 | ------------------------------------------------------------------------------- |
| | 4147 | */ |
| | 4148 | #define mix(a,b,c) \ |
| | 4149 | { \ |
| | 4150 | a -= c; a ^= rot(c, 4); c += b; \ |
| | 4151 | b -= a; b ^= rot(a, 6); a += c; \ |
| | 4152 | c -= b; c ^= rot(b, 8); b += a; \ |
| | 4153 | a -= c; a ^= rot(c,16); c += b; \ |
| | 4154 | b -= a; b ^= rot(a,19); a += c; \ |
| | 4155 | c -= b; c ^= rot(b, 4); b += a; \ |
| | 4156 | } |
| | 4157 | |
| | 4158 | /* |
| | 4159 | ------------------------------------------------------------------------------- |
| | 4160 | final -- final mixing of 3 32-bit values (a,b,c) into c |
| | 4161 | |
| | 4162 | Pairs of (a,b,c) values differing in only a few bits will usually |
| | 4163 | produce values of c that look totally different. This was tested for |
| | 4164 | * pairs that differed by one bit, by two bits, in any combination |
| | 4165 | of top bits of (a,b,c), or in any combination of bottom bits of |
| | 4166 | (a,b,c). |
| | 4167 | * "differ" is defined as +, -, ^, or ~^. For + and -, I transformed |
| | 4168 | the output delta to a Gray code (a^(a>>1)) so a string of 1's (as |
| | 4169 | is commonly produced by subtraction) look like a single 1-bit |
| | 4170 | difference. |
| | 4171 | * the base values were pseudorandom, all zero but one bit set, or |
| | 4172 | all zero plus a counter that starts at zero. |
| | 4173 | |
| | 4174 | These constants passed: |
| | 4175 | 14 11 25 16 4 14 24 |
| | 4176 | 12 14 25 16 4 14 24 |
| | 4177 | and these came close: |
| | 4178 | 4 8 15 26 3 22 24 |
| | 4179 | 10 8 15 26 3 22 24 |
| | 4180 | 11 8 15 26 3 22 24 |
| | 4181 | ------------------------------------------------------------------------------- |
| | 4182 | */ |
| | 4183 | #define final(a,b,c) \ |
| | 4184 | { \ |
| | 4185 | c ^= b; c -= rot(b,14); \ |
| | 4186 | a ^= c; a -= rot(c,11); \ |
| | 4187 | b ^= a; b -= rot(a,25); \ |
| | 4188 | c ^= b; c -= rot(b,16); \ |
| | 4189 | a ^= c; a -= rot(c,4); \ |
| | 4190 | b ^= a; b -= rot(a,14); \ |
| | 4191 | c ^= b; c -= rot(b,24); \ |
| | 4192 | } |
| | 4193 | |
| | 4194 | |
| | 4195 | /* |
| | 4196 | ------------------------------------------------------------------------------- |
| | 4197 | hashlittle() -- hash a variable-length key into a 32-bit value |
| | 4198 | k : the key (the unaligned variable-length array of bytes) |
| | 4199 | length : the length of the key, counting by bytes |
| | 4200 | initval : can be any 4-byte value |
| | 4201 | Returns a 32-bit value. Every bit of the key affects every bit of |
| | 4202 | the return value. Two keys differing by one or two bits will have |
| | 4203 | totally different hash values. |
| | 4204 | |
| | 4205 | The best hash table sizes are powers of 2. There is no need to do |
| | 4206 | mod a prime (mod is sooo slow!). If you need less than 32 bits, |
| | 4207 | use a bitmask. For example, if you need only 10 bits, do |
| | 4208 | h = (h & hashmask(10)); |
| | 4209 | In which case, the hash table should have hashsize(10) elements. |
| | 4210 | |
| | 4211 | If you are hashing n strings (uint8_t **)k, do it like this: |
| | 4212 | for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h); |
| | 4213 | |
| | 4214 | By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this |
| | 4215 | code any way you wish, private, educational, or commercial. It's free. |
| | 4216 | |
| | 4217 | Use for hash table lookup, or anything where one collision in 2^^32 is |
| | 4218 | acceptable. Do NOT use for cryptographic purposes. |
| | 4219 | ------------------------------------------------------------------------------- |
| | 4220 | */ |
| | 4221 | static uint32_t hashlittle( const void *key, size_t length, uint32_t initval) |
| | 4222 | { |
| | 4223 | uint32_t a,b,c; /* internal state */ |
| | 4224 | union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ |
| | 4225 | |
| | 4226 | /* Set up the internal state */ |
| | 4227 | a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; |
| | 4228 | |
| | 4229 | u.ptr = key; |
| | 4230 | if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { |
| | 4231 | const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ |
| | 4232 | #ifdef VALGRIND |
| | 4233 | const uint8_t *k8; |
| | 4234 | #endif |
| | 4235 | |
| | 4236 | /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ |
| | 4237 | while (length > 12) |
| | 4238 | { |
| | 4239 | a += k[0]; |
| | 4240 | b += k[1]; |
| | 4241 | c += k[2]; |
| | 4242 | mix(a,b,c); |
| | 4243 | length -= 12; |
| | 4244 | k += 3; |
| | 4245 | } |
| | 4246 | |
| | 4247 | /*----------------------------- handle the last (probably partial) block */ |
| | 4248 | /* |
| | 4249 | * "k[2]&0xffffff" actually reads beyond the end of the string, but |
| | 4250 | * then masks off the part it's not allowed to read. Because the |
| | 4251 | * string is aligned, the masked-off tail is in the same word as the |
| | 4252 | * rest of the string. Every machine with memory protection I've seen |
| | 4253 | * does it on word boundaries, so is OK with this. But VALGRIND will |
| | 4254 | * still catch it and complain. The masking trick does make the hash |
| | 4255 | * noticably faster for short strings (like English words). |
| | 4256 | */ |
| | 4257 | #ifndef VALGRIND |
| | 4258 | |
| | 4259 | switch(length) |
| | 4260 | { |
| | 4261 | case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; |
| | 4262 | case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; |
| | 4263 | case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; |
| | 4264 | case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; |
| | 4265 | case 8 : b+=k[1]; a+=k[0]; break; |
| | 4266 | case 7 : b+=k[1]&0xffffff; a+=k[0]; break; |
| | 4267 | case 6 : b+=k[1]&0xffff; a+=k[0]; break; |
| | 4268 | case 5 : b+=k[1]&0xff; a+=k[0]; break; |
| | 4269 | case 4 : a+=k[0]; break; |
| | 4270 | case 3 : a+=k[0]&0xffffff; break; |
| | 4271 | case 2 : a+=k[0]&0xffff; break; |
| | 4272 | case 1 : a+=k[0]&0xff; break; |
| | 4273 | case 0 : return c; /* zero length strings require no mixing */ |
| | 4274 | } |
| | 4275 | |
| | 4276 | #else /* make valgrind happy */ |
| | 4277 | |
| | 4278 | k8 = (const uint8_t *)k; |
| | 4279 | switch(length) |
| | 4280 | { |
| | 4281 | case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; |
| | 4282 | case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ |
| | 4283 | case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ |
| | 4284 | case 9 : c+=k8[8]; /* fall through */ |
| | 4285 | case 8 : b+=k[1]; a+=k[0]; break; |
| | 4286 | case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ |
| | 4287 | case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ |
| | 4288 | case 5 : b+=k8[4]; /* fall through */ |
| | 4289 | case 4 : a+=k[0]; break; |
| | 4290 | case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ |
| | 4291 | case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ |
| | 4292 | case 1 : a+=k8[0]; break; |
| | 4293 | case 0 : return c; |
| | 4294 | } |
| | 4295 | |
| | 4296 | #endif /* !valgrind */ |
| | 4297 | |
| | 4298 | } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { |
| | 4299 | const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ |
| | 4300 | const uint8_t *k8; |
| | 4301 | |
| | 4302 | /*--------------- all but last block: aligned reads and different mixing */ |
| | 4303 | while (length > 12) |
| | 4304 | { |
| | 4305 | a += k[0] + (((uint32_t)k[1])<<16); |
| | 4306 | b += k[2] + (((uint32_t)k[3])<<16); |
| | 4307 | c += k[4] + (((uint32_t)k[5])<<16); |
| | 4308 | mix(a,b,c); |
| | 4309 | length -= 12; |
| | 4310 | k += 6; |
| | 4311 | } |
| | 4312 | |
| | 4313 | /*----------------------------- handle the last (probably partial) block */ |
| | 4314 | k8 = (const uint8_t *)k; |
| | 4315 | switch(length) |
| | 4316 | { |
| | 4317 | case 12: c+=k[4]+(((uint32_t)k[5])<<16); |
| | 4318 | b+=k[2]+(((uint32_t)k[3])<<16); |
| | 4319 | a+=k[0]+(((uint32_t)k[1])<<16); |
| | 4320 | break; |
| | 4321 | case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ |
| | 4322 | case 10: c+=k[4]; |
| | 4323 | b+=k[2]+(((uint32_t)k[3])<<16); |
| | 4324 | a+=k[0]+(((uint32_t)k[1])<<16); |
| | 4325 | break; |
| | 4326 | case 9 : c+=k8[8]; /* fall through */ |
| | 4327 | case 8 : b+=k[2]+(((uint32_t)k[3])<<16); |
| | 4328 | a+=k[0]+(((uint32_t)k[1])<<16); |
| | 4329 | break; |
| | 4330 | case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ |
| | 4331 | case 6 : b+=k[2]; |
| | 4332 | a+=k[0]+(((uint32_t)k[1])<<16); |
| | 4333 | break; |
| | 4334 | case 5 : b+=k8[4]; /* fall through */ |
| | 4335 | case 4 : a+=k[0]+(((uint32_t)k[1])<<16); |
| | 4336 | break; |
| | 4337 | case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ |
| | 4338 | case 2 : a+=k[0]; |
| | 4339 | break; |
| | 4340 | case 1 : a+=k8[0]; |
| | 4341 | break; |
| | 4342 | case 0 : return c; /* zero length requires no mixing */ |
| | 4343 | } |
| | 4344 | |
| | 4345 | } else { /* need to read the key one byte at a time */ |
| | 4346 | const uint8_t *k = (const uint8_t *)key; |
| | 4347 | |
| | 4348 | /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ |
| | 4349 | while (length > 12) |
| | 4350 | { |
| | 4351 | a += k[0]; |
| | 4352 | a += ((uint32_t)k[1])<<8; |
| | 4353 | a += ((uint32_t)k[2])<<16; |
| | 4354 | a += ((uint32_t)k[3])<<24; |
| | 4355 | b += k[4]; |
| | 4356 | b += ((uint32_t)k[5])<<8; |
| | 4357 | b += ((uint32_t)k[6])<<16; |
| | 4358 | b += ((uint32_t)k[7])<<24; |
| | 4359 | c += k[8]; |
| | 4360 | c += ((uint32_t)k[9])<<8; |
| | 4361 | c += ((uint32_t)k[10])<<16; |
| | 4362 | c += ((uint32_t)k[11])<<24; |
| | 4363 | mix(a,b,c); |
| | 4364 | length -= 12; |
| | 4365 | k += 12; |
| | 4366 | } |
| | 4367 | |
| | 4368 | /*-------------------------------- last block: affect all 32 bits of (c) */ |
| | 4369 | switch(length) /* all the case statements fall through */ |
| | 4370 | { |
| | 4371 | case 12: c+=((uint32_t)k[11])<<24; |
| | 4372 | case 11: c+=((uint32_t)k[10])<<16; |
| | 4373 | case 10: c+=((uint32_t)k[9])<<8; |
| | 4374 | case 9 : c+=k[8]; |
| | 4375 | case 8 : b+=((uint32_t)k[7])<<24; |
| | 4376 | case 7 : b+=((uint32_t)k[6])<<16; |
| | 4377 | case 6 : b+=((uint32_t)k[5])<<8; |
| | 4378 | case 5 : b+=k[4]; |
| | 4379 | case 4 : a+=((uint32_t)k[3])<<24; |
| | 4380 | case 3 : a+=((uint32_t)k[2])<<16; |
| | 4381 | case 2 : a+=((uint32_t)k[1])<<8; |
| | 4382 | case 1 : a+=k[0]; |
| | 4383 | break; |
| | 4384 | case 0 : return c; |
| | 4385 | } |
| | 4386 | } |
| | 4387 | |
| | 4388 | final(a,b,c); |
| | 4389 | return c; |
| | 4390 | } |
| | 4391 | |
| | 4392 | static int addr_hash_compare(void* key, struct qhash_head* link) |
| | 4393 | { |
| | 4394 | uint32_t *addr_hash = key; |
| | 4395 | struct tcp_addr *tcp_addr_data = NULL; |
| | 4396 | |
| | 4397 | tcp_addr_data = qhash_entry(link, struct tcp_addr, hash_link); |
| | 4398 | assert(tcp_addr_data); |
| | 4399 | |
| | 4400 | if(tcp_addr_data->addr_hash == *addr_hash) |
| | 4401 | { |
| | 4402 | return(1); |
| | 4403 | } |
| | 4404 | return(0); |
| | 4405 | } |
| | 4406 | |
| | 4407 | /* |