Skip to content

Commit

Permalink
smb scheme smb://....
Browse files Browse the repository at this point in the history
  • Loading branch information
ksherlock committed Aug 11, 2013
1 parent fff9954 commit 8f0eb50
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ void parse_scheme(const char *cp, unsigned size, URLComponents *c)
c->portNumber = 2628;
return;
}
// smb
if (size == 3
&& (wp[0] | 0x2020) == 0x6d73 // 'sm'
&& (cp[2] | 0x20) == 0x62 // 'b'
) {
c->schemeType = SCHEME_SMB;
c->portNumber = 445;
return;
}
// ssh
if (size == 3
&& (wp[0] | 0x2020) == 0x7373 // 'ss'
Expand Down
7 changes: 7 additions & 0 deletions scheme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,10 @@ void parse_scheme(const char *cp, unsigned size, URLComponents *c)
c->portNumber = 2628;
return;
.

'smb' ->
c->schemeType = SCHEME_SMB;
c->portNumber = 445;
return;
.

1 change: 1 addition & 0 deletions url.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum {
SCHEME_NFS = 2049,
SCHEME_NNTP = 119,
SCHEME_SFTP = 115,
SCHEME_SMB = 445,
SCHEME_SSH = 22,
SCHEME_TELNET = 23
};
Expand Down

0 comments on commit 8f0eb50

Please sign in to comment.