smb_conn.h (78208) | smb_conn.h (87192) |
---|---|
1/* 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/netsmb/smb_conn.h 78208 2001-06-14 11:05:01Z bp $ | 32 * $FreeBSD: head/sys/netsmb/smb_conn.h 87192 2001-12-02 08:47:29Z bp $ |
33 */ 34 35/* 36 * Two levels of connection hierarchy 37 */ 38#define SMBL_SM 0 39#define SMBL_VC 1 40#define SMBL_SHARE 2 --- 216 unchanged lines hidden (view full) --- 257 u_char vc_hflags; /* or'ed with flags in the smb header */ 258 u_short vc_hflags2; /* or'ed with flags in the smb header */ 259 void * vc_tdata; /* transport control block */ 260 struct smb_tran_desc *vc_tdesc; 261 int vc_chlen; /* actual challenge length */ 262 u_char vc_ch[SMB_MAXCHALLENGELEN]; 263 u_short vc_mid; /* multiplex id */ 264 struct smb_sopt vc_sopt; /* server options */ | 33 */ 34 35/* 36 * Two levels of connection hierarchy 37 */ 38#define SMBL_SM 0 39#define SMBL_VC 1 40#define SMBL_SHARE 2 --- 216 unchanged lines hidden (view full) --- 257 u_char vc_hflags; /* or'ed with flags in the smb header */ 258 u_short vc_hflags2; /* or'ed with flags in the smb header */ 259 void * vc_tdata; /* transport control block */ 260 struct smb_tran_desc *vc_tdesc; 261 int vc_chlen; /* actual challenge length */ 262 u_char vc_ch[SMB_MAXCHALLENGELEN]; 263 u_short vc_mid; /* multiplex id */ 264 struct smb_sopt vc_sopt; /* server options */ |
265 struct smb_cred*vc_scred; /* used in reconnect procedure */ | |
266 int vc_txmax; /* max tx/rx packet size */ 267 struct smbiod * vc_iod; 268 struct smb_slock vc_stlock; 269}; 270 271#define vc_maxmux vc_sopt.sv_maxmux 272#define vc_flags obj.co_flags 273 --- 16 unchanged lines hidden (view full) --- 290 u_short ss_tid; /* TID */ 291 int ss_type; /* share type */ 292 uid_t ss_uid; /* user id of connection */ 293 gid_t ss_grp; /* group of connection */ 294 mode_t ss_mode; /* access mode */ 295 int ss_vcgenid; 296 char * ss_pass; /* password to a share, can be null */ 297 struct smb_slock ss_stlock; | 265 int vc_txmax; /* max tx/rx packet size */ 266 struct smbiod * vc_iod; 267 struct smb_slock vc_stlock; 268}; 269 270#define vc_maxmux vc_sopt.sv_maxmux 271#define vc_flags obj.co_flags 272 --- 16 unchanged lines hidden (view full) --- 289 u_short ss_tid; /* TID */ 290 int ss_type; /* share type */ 291 uid_t ss_uid; /* user id of connection */ 292 gid_t ss_grp; /* group of connection */ 293 mode_t ss_mode; /* access mode */ 294 int ss_vcgenid; 295 char * ss_pass; /* password to a share, can be null */ 296 struct smb_slock ss_stlock; |
298 struct smb_cred *ss_cred; /* used in reconnect procedure */ | |
299}; 300 301#define ss_flags obj.co_flags 302 303#define CPTOVC(cp) ((struct smb_vc*)(cp)) 304#define VCTOCP(vcp) (&(vcp)->obj) 305#define CPTOSS(cp) ((struct smb_share*)(cp)) 306#define SSTOVC(ssp) CPTOVC(((ssp)->obj.co_parent)) --- 42 unchanged lines hidden (view full) --- 349int smb_sm_done(void); 350int smb_sm_lookup(struct smb_vcspec *vcspec, 351 struct smb_sharespec *shspec, struct smb_cred *scred, 352 struct smb_vc **vcpp); 353 354/* 355 * Connection object 356 */ | 297}; 298 299#define ss_flags obj.co_flags 300 301#define CPTOVC(cp) ((struct smb_vc*)(cp)) 302#define VCTOCP(vcp) (&(vcp)->obj) 303#define CPTOSS(cp) ((struct smb_share*)(cp)) 304#define SSTOVC(ssp) CPTOVC(((ssp)->obj.co_parent)) --- 42 unchanged lines hidden (view full) --- 347int smb_sm_done(void); 348int smb_sm_lookup(struct smb_vcspec *vcspec, 349 struct smb_sharespec *shspec, struct smb_cred *scred, 350 struct smb_vc **vcpp); 351 352/* 353 * Connection object 354 */ |
357void smb_co_ref(struct smb_connobj *cp, struct proc *p); | 355void smb_co_ref(struct smb_connobj *cp); |
358void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred); 359int smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred); 360void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred); | 356void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred); 357int smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred); 358void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred); |
361int smb_co_lock(struct smb_connobj *cp, int flags, struct proc *p); 362void smb_co_unlock(struct smb_connobj *cp, int flags, struct proc *p); | 359int smb_co_lock(struct smb_connobj *cp, int flags, struct thread *td); 360void smb_co_unlock(struct smb_connobj *cp, int flags, struct thread *td); |
363 364/* 365 * session level functions 366 */ 367int smb_vc_create(struct smb_vcspec *vcspec, 368 struct smb_cred *scred, struct smb_vc **vcpp); 369int smb_vc_connect(struct smb_vc *vcp, struct smb_cred *scred); 370int smb_vc_access(struct smb_vc *vcp, struct smb_cred *scred, mode_t mode); 371int smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred); 372void smb_vc_put(struct smb_vc *vcp, struct smb_cred *scred); | 361 362/* 363 * session level functions 364 */ 365int smb_vc_create(struct smb_vcspec *vcspec, 366 struct smb_cred *scred, struct smb_vc **vcpp); 367int smb_vc_connect(struct smb_vc *vcp, struct smb_cred *scred); 368int smb_vc_access(struct smb_vc *vcp, struct smb_cred *scred, mode_t mode); 369int smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred); 370void smb_vc_put(struct smb_vc *vcp, struct smb_cred *scred); |
373void smb_vc_ref(struct smb_vc *vcp, struct proc *p); | 371void smb_vc_ref(struct smb_vc *vcp); |
374void smb_vc_rele(struct smb_vc *vcp, struct smb_cred *scred); | 372void smb_vc_rele(struct smb_vc *vcp, struct smb_cred *scred); |
375int smb_vc_lock(struct smb_vc *vcp, int flags, struct proc *p); 376void smb_vc_unlock(struct smb_vc *vcp, int flags, struct proc *p); | 373int smb_vc_lock(struct smb_vc *vcp, int flags, struct thread *td); 374void smb_vc_unlock(struct smb_vc *vcp, int flags, struct thread *td); |
377int smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *shspec, 378 struct smb_cred *scred, struct smb_share **sspp); 379const char * smb_vc_getpass(struct smb_vc *vcp); 380u_short smb_vc_nextmid(struct smb_vc *vcp); 381 382/* 383 * share level functions 384 */ 385int smb_share_create(struct smb_vc *vcp, struct smb_sharespec *shspec, 386 struct smb_cred *scred, struct smb_share **sspp); 387int smb_share_access(struct smb_share *ssp, struct smb_cred *scred, mode_t mode); | 375int smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *shspec, 376 struct smb_cred *scred, struct smb_share **sspp); 377const char * smb_vc_getpass(struct smb_vc *vcp); 378u_short smb_vc_nextmid(struct smb_vc *vcp); 379 380/* 381 * share level functions 382 */ 383int smb_share_create(struct smb_vc *vcp, struct smb_sharespec *shspec, 384 struct smb_cred *scred, struct smb_share **sspp); 385int smb_share_access(struct smb_share *ssp, struct smb_cred *scred, mode_t mode); |
388void smb_share_ref(struct smb_share *ssp, struct proc *p); | 386void smb_share_ref(struct smb_share *ssp); |
389void smb_share_rele(struct smb_share *ssp, struct smb_cred *scred); 390int smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred); 391void smb_share_put(struct smb_share *ssp, struct smb_cred *scred); | 387void smb_share_rele(struct smb_share *ssp, struct smb_cred *scred); 388int smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred); 389void smb_share_put(struct smb_share *ssp, struct smb_cred *scred); |
392int smb_share_lock(struct smb_share *ssp, int flags, struct proc *p); 393void smb_share_unlock(struct smb_share *ssp, int flags, struct proc *p); | 390int smb_share_lock(struct smb_share *ssp, int flags, struct thread *td); 391void smb_share_unlock(struct smb_share *ssp, int flags, struct thread *td); |
394void smb_share_invalidate(struct smb_share *ssp); 395int smb_share_valid(struct smb_share *ssp); 396const char * smb_share_getpass(struct smb_share *ssp); 397 398/* 399 * SMB protocol level functions 400 */ 401int smb_smb_negotiate(struct smb_vc *vcp, struct smb_cred *scred); --- 35 unchanged lines hidden (view full) --- 437 enum smbiod_state iod_state; 438 int iod_muxcnt; /* number of active outstanding requests */ 439 int iod_sleeptimo; 440 struct smb_vc * iod_vc; 441 struct smb_slock iod_rqlock; /* iod_rqlist, iod_muxwant */ 442 struct smb_rqhead iod_rqlist; /* list of outstanding requests */ 443 int iod_muxwant; 444 struct proc * iod_p; | 392void smb_share_invalidate(struct smb_share *ssp); 393int smb_share_valid(struct smb_share *ssp); 394const char * smb_share_getpass(struct smb_share *ssp); 395 396/* 397 * SMB protocol level functions 398 */ 399int smb_smb_negotiate(struct smb_vc *vcp, struct smb_cred *scred); --- 35 unchanged lines hidden (view full) --- 435 enum smbiod_state iod_state; 436 int iod_muxcnt; /* number of active outstanding requests */ 437 int iod_sleeptimo; 438 struct smb_vc * iod_vc; 439 struct smb_slock iod_rqlock; /* iod_rqlist, iod_muxwant */ 440 struct smb_rqhead iod_rqlist; /* list of outstanding requests */ 441 int iod_muxwant; 442 struct proc * iod_p; |
443 struct thread * iod_td; |
|
445 struct smb_cred iod_scred; 446 struct smb_slock iod_evlock; /* iod_evlist */ 447 STAILQ_HEAD(,smbiod_event) iod_evlist; 448 struct timespec iod_lastrqsent; 449 struct timespec iod_pingtimo; 450}; 451 452int smb_iod_init(void); 453int smb_iod_done(void); 454int smb_iod_create(struct smb_vc *vcp); 455int smb_iod_destroy(struct smbiod *iod); 456int smb_iod_request(struct smbiod *iod, int event, void *ident); 457int smb_iod_addrq(struct smb_rq *rqp); 458int smb_iod_waitrq(struct smb_rq *rqp); 459int smb_iod_removerq(struct smb_rq *rqp); 460 461#endif /* _KERNEL */ | 444 struct smb_cred iod_scred; 445 struct smb_slock iod_evlock; /* iod_evlist */ 446 STAILQ_HEAD(,smbiod_event) iod_evlist; 447 struct timespec iod_lastrqsent; 448 struct timespec iod_pingtimo; 449}; 450 451int smb_iod_init(void); 452int smb_iod_done(void); 453int smb_iod_create(struct smb_vc *vcp); 454int smb_iod_destroy(struct smbiod *iod); 455int smb_iod_request(struct smbiod *iod, int event, void *ident); 456int smb_iod_addrq(struct smb_rq *rqp); 457int smb_iod_waitrq(struct smb_rq *rqp); 458int smb_iod_removerq(struct smb_rq *rqp); 459 460#endif /* _KERNEL */ |