Changeset 25992 in vbox for trunk/src/VBox/Devices/Network/slirp/libalias
- Timestamp:
- Jan 25, 2010 11:03:51 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56863
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_nbt.c
r25301 r25992 71 71 # include "alias_local.h" 72 72 # include "alias_mod.h" 73 # define isprint RT_C_IS_PRINT 73 74 #endif /*VBOX*/ 74 75 … … 77 78 78 79 static int 79 AliasHandleUdpNbt(struct libalias *, struct ip *, struct alias_link *, 80 AliasHandleUdpNbt(struct libalias *, struct ip *, struct alias_link *, 80 81 struct in_addr *, u_short); 81 82 … … 83 84 AliasHandleUdpNbtNS(struct libalias *, struct ip *, struct alias_link *, 84 85 struct in_addr *, u_short *, struct in_addr *, u_short *); 85 static int 86 static int 86 87 fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah) 87 88 { 88 89 89 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 90 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 90 91 ah->aaddr == NULL || ah->aport == NULL) 91 92 return (-1); 92 93 if (ntohs(*ah->dport) == NETBIOS_DGM_PORT_NUMBER 93 || ntohs(*ah->sport) == NETBIOS_DGM_PORT_NUMBER) 94 || ntohs(*ah->sport) == NETBIOS_DGM_PORT_NUMBER) 94 95 return (0); 95 96 return (-1); 96 97 } 97 98 98 static int 99 static int 99 100 protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) 100 101 { 101 102 102 103 AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport); 103 104 return (0); 104 105 } 105 106 106 static int 107 static int 107 108 fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah) 108 109 { 109 110 110 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 111 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 111 112 ah->aaddr == NULL || ah->aport == NULL) 112 113 return (-1); … … 117 118 } 118 119 119 static int 120 static int 120 121 protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah) 121 122 { 122 123 123 124 AliasHandleUdpNbtNS(la, pip, ah->lnk, ah->aaddr, ah->aport, 124 125 ah->oaddr, ah->dport); … … 126 127 } 127 128 128 static int 129 static int 129 130 protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) 130 131 { 131 132 132 133 AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport, 133 134 ah->aaddr, ah->aport); … … 138 139 #ifndef VBOX 139 140 struct proto_handler handlers[] = { 140 { 141 .pri = 130, 142 .dir = IN|OUT, 143 .proto = UDP, 144 .fingerprint = &fingerprint1, 141 { 142 .pri = 130, 143 .dir = IN|OUT, 144 .proto = UDP, 145 .fingerprint = &fingerprint1, 145 146 .protohandler = &protohandler1 146 }, 147 { 148 .pri = 140, 149 .dir = IN, 150 .proto = UDP, 151 .fingerprint = &fingerprint2, 147 }, 148 { 149 .pri = 140, 150 .dir = IN, 151 .proto = UDP, 152 .fingerprint = &fingerprint2, 152 153 .protohandler = &protohandler2in 153 }, 154 { 155 .pri = 140, 156 .dir = OUT, 157 .proto = UDP, 158 .fingerprint = &fingerprint2, 154 }, 155 { 156 .pri = 140, 157 .dir = OUT, 158 .proto = UDP, 159 .fingerprint = &fingerprint2, 159 160 .protohandler = &protohandler2out 160 }, 161 }, 161 162 { EOH } 162 163 }; 163 164 #else /* !VBOX */ 164 #define handlers pData->nbt_module 165 #define handlers pData->nbt_module 165 166 #endif /*VBOX*/ 166 167 … … 195 196 handlers[0].fingerprint = &fingerprint1; 196 197 handlers[0].protohandler = &protohandler1; 197 198 198 199 199 200 handlers[1].pri = 140; 200 201 handlers[1].dir = IN; … … 202 203 handlers[1].fingerprint = &fingerprint2; 203 204 handlers[1].protohandler = &protohandler2in; 204 205 205 206 206 207 handlers[2].pri = 140; 207 208 handlers[2].dir = OUT; … … 209 210 handlers[2].fingerprint = &fingerprint2; 210 211 handlers[2].protohandler = &protohandler2out; 211 212 212 213 handlers[3].pri = EOH; 213 214 #endif /*VBOX*/ … … 240 241 #ifndef VBOX 241 242 #ifdef _KERNEL 242 static 243 static 243 244 #endif 244 245 moduledata_t alias_mod = {
Note:
See TracChangeset
for help on using the changeset viewer.