FNS コンテキストを管理する (コンテキストの内容を確認する) ためのツールには様々な種類があります。以下の表は、そのツール (コマンド) の構文を示したものです。
fnlookup は、複合名のバインドに関する情報を表示するのに使用します。
fnlookup [-v][-L] composite_name |
オプション |
説明 |
---|---|
-v |
詳細なバインド関連情報を表示する |
-L |
「XFN リンクのバインド先となるのはどのリファレンスか」を表示する |
たとえば、以下の例では、ユーザー darwin のバインドに関する情報が表示されます。
# fnlookup -v user/darwin/ Reference type: onc_fn_user Address type: onc_fn_nisplus length: 52 context type: user representation: normal version: 0 internal name: fns_user_darwin.ctx_dir.sales.doc.com. |
ここで user/Charles.Darwin が user/darwin にリンクされているとすると、下の例の最初のコマンドでは、user/Charles.Darwin のバインド先 (XFNリンク) が表示されます。2 番目のコマンドでは、XFNリンク user/jjones が調べられ、user/darwin のバインド先 (user コンテキスト) が表示されます。
# fnlookup user/Charles.Darwin Reference type: fn_link_ref Address type: fn_link_addr Link name: user/darwin # fnlookup -L user/Charles.Darwin Reference type: onc_fn_user Address type: onc_fn_nisplus context type: user |
fnlist は、コンテキストの内容を表示するのに使用されます。
fnlist [-lv] [name] |
オプション |
説明 |
---|---|
-v |
バインドに関する詳細な情報を表示する |
-l |
コンテキスト中でバインドされている名前に関する情報を表示する |
以下の例では、user コンテキストにバインドされている名前が表示されます。
# fnlist user/ Listing 'user/': jjones julio chaim James.Jones |
名前を指定しないと、初期コンテキストの内容が表示されます。
# fnlist Listing '': _myorgunit ... _myself thishost myself _orgunit _x500 _host _thisens myens thisens org orgunit _dns thisuser _thishost myorgunit _user thisorgunit host _thisorgunit _myens user |
-l オプションを指定すると、指定されたコンテキスト中でバインドされている名前に関する情報が表示されます。
# fnlist -l user/ Listing bindings 'user/': name: julio Reference type: onc_fn_user Address type: onc_fn_nisplus context type: user name: chaim Reference type: onc_fn_user Address type: onc_fn_nisplus context type: user name: James.Jones Reference type: fn_link_ref Address type: fn_link_addr Link name: user/jjones name: jjones Reference type: onc_fn_user Address type: onc_fn_nisplus context type: user |
-l、-v オプションを同時に指定すると、バインドされた名前に関するさらに詳細な情報が表示されます。
# fnlist -lv user/ Listing bindings 'user/': name: julio Reference type: onc_fn_user Address type: onc_fn_nisplus length: 52 context type: user representation: normal version: 0 internal name: fns_user_julio.ctx_dir.sales.doc.com. name: chaim Reference type: onc_fn_user Address type: onc_fn_nisplus length: 52 context type: user representation: normal version: 0 internal name: fns_user_chaim.ctx_dir.sales.doc.com. name: James.Jones Reference type: fn_link_ref Address type: fn_link_addr length: 11 data: 0x75 0x73 0x65 0x72 0x2f 0x6a 0x6a 0x6f 0x6e 0x65 user/jjones name: jjones Reference type: onc_fn_user Address type: onc_fn_nisplus length: 52 context type: user representation: normal version: 0 internal name: fns_user_jjones.ctx_dir.sales.doc.com. |
fnbind は、複合名をリファレンスにバインドするためのコマンドです。
このコマンドには、2 種類の構文があります。
すでに存在する名前のリファレンスを新しい名前にバインドするもの (以下参照)
コマンド行の引数にもとづいて作成されたリファレンスを、別の名前にバインドするもの (「コマンド行にリファレンスを作成する」を参照)
既存の名前を新しい名前にバインドするための fnbind の構文は以下のようになります。
fnbind [-s][-v][-L] oldname newname |
オプション |
説明 |
---|---|
oldname |
すでに存在している複合名 |
newname |
すでに存在している複合名にバインドする新しい名前 |
-s |
複合名がすでにバインドされている場合、バインドを上書きする |
-v |
バインドに使用されたリファレンスに関する情報を表示する |
-L |
name を使用して XFN リンクを作成し、それを new_name にバインドする |
たとえば、以下のコマンドでは、user/julio/service/printer という名前が myorgunit/service/printer のリファレンスにバインドされます。
# fnbind myorgunit/service/printer user/julio/service/printer |
newname がすでにバインドされている場合は、fnbind -s を使用しないと処理が正しく行われません。つまり上記の例で user/julio/service/printer がすでにバインドされていれば、以下のように -s オプションを使用して myorgunit/service/printer とのバインドで上書きする必要があるということになります。
# fnbind -s myorgunit/service/printer user/julio/service/printer |
-v オプションは、バインドに使用されたリファレンスに関する情報を表示するのに使用されます。
# fnbind -v myorgunit/service/printer user/julio/service/printer Reference type: onc_printers Address type: onc_fn_printer_nisplus |
以下の例では、user/jjones によって XFN リンクが作成され、user/James.Jones という名前にバインドされます。
# fnbind -L user/jjones user/James.Jones |
同様に以下の例では、user/julio/service/printer から myorgunit/service/printer へのリンクが作成されます。
# fnbind -sL myorgunit/service/printer user/julio/service/printer |
コマンド行にリファレンスを作成するための fnbind の構文は次のようになります。
fnbind -r [-s] [-v] newname [-O | -U] reftype {[-O | -U] | addresstype [-c|-x] addresscontents}+ |
オプション |
説明 |
---|---|
newname |
リファレンスを作成する新しい名前 |
reftype |
作成するリファレンスのタイプ。-O、-U オプションを使用しない場合は、reftype の識別子として FN_ID_STRING を使用する |
addresstype |
作成するアドレスのタイプ。-O、-U オプションを使用しない場合は、addresstype の識別子として FN_ID_STRING を使用する |
addresscontents |
作成するリファレンスのアドレス。-c あるいは -x オプションを使用しない場合、アドレスは XDR によって符号化された文字列として保存される |
-s |
複合名がすでにバインドされている場合、バインドを上書きする |
-v |
バインドに使用されたリファレンスに関する情報を表示する |
-c |
アドレス内容を、XDR による符号化を行わずに保存する |
-x |
アドレス内容を 16 進数で入力された文字列であると解釈し、そのまま保存する |
-r |
指定タイプのリファレンスを作成し、コマンド行で指定された名前にバインドする |
-O |
タイプを指定する文字列を、ASN.1 の形式 (整数をいくつか並べてドットで区切ったもの) として解釈して保存する |
-U |
タイプを指定する文字列を、DCE UUID として解釈して保存する |
たとえば、以下の例では、thisorgunit/service/calendar という名前が、「タイプ onc_calendar、アドレスタイプ onc_cal_str、アドレス staff@cygnus」というリファレンスにバインドされます。
# fnbind -r thisorgunit/service/calendar onc_calendar onc_cal_str staff@cygnus |
コマンド行で指定されたアドレスは、デフォルトでは XDR で符号化された後、リファレンスに保存されます。-c オプションが指定された場合は、XDR による符号化は行われず、そのままの形で保存されます。-x オプションが指定された場合は、16 進文字列として解釈されて保存されます (XDR による符号化は行われない)。
リファレンス (およびそのアドレス) のタイプの指定には、デフォルトでは FN_ID_STRING
識別子の形式が使用されます。-O オプションでは FN_ID_ISO_OID_STRING
(ASN.1、10進数を並べてドットで区切る) の形式が、-U オプションでは FN_ID_DCE_UUID
(DCE UUID、文字列を使用する) の形式が使用されます。
ASN.1 の詳細は、『ISO 8824: 1990, Information Technology - Open Systems Interconnection - Specification of Abstract Syntax Notation One (ASN.1)』を参照してください。DCE UUID の詳細は、『X/Open Preliminary Specification, October 1993, X/Open DCE: Remote Procedure Call (ISBN: 1-872630-95-2)』を参照してください。
以下の例では、thisorgunit/service/nx という名前にバインドされるリファレンス (およびそのアドレス) の、タイプが OIDs の形式で、アドレスが 16 進の文字列で指定されています。
# fnbind -r thisorgunit/service/nx -O 1.2.99.6.2.1 -O 1.2.99.6.2.3 -x ef12eab67290 |
fnunbind は、複合名を名前空間から削除するのに使用されます。ただし、名前に対応するオブジェクトは削除されず、オブジェクトと名前のバインドを解除するだけであるという点に注意してください。
以下の例では、user/jjones/service/printer/color という複合名が削除されます。
# fnunbind user/jjones/service/printer/color |
fnrename は、コンテキストにバインドされている名前を変更するのに使用されます。
以下の例では user/jjones/service/ というコンテキストにバインドされた、clndr という名前が calendar に変更されます。
# fnunbind user/jjones/service/printer/color |
fndestroy は、指定された複合名を名前空間から削除し、その名前を持つコンテキストを削除するのに使用されます。
たとえば、user/jones/ という名前を名前空間とのバインドから解除し、user/jjones/ という名前のコンテキストを削除するには、以下のように入力します。
# fndestroy user/jjones/ |
削除の対象となるコンテキスト (指定された複合名を持つもの) にサブコンテキストが存在する場合、コマンドは正常に動作しません。